Syntax highlighting settings
In linux, the vim or vi editor does not highlight nginx Syntax by default.
Manual configuration is required.
1. Download vi syntax highlighting configuration ~ /. Vim/syntax. This directory is created if it does not exist.
The code is as follows: |
Copy code |
Cd ~ /. Vim/syntax Wget http://www.vim.org/scripts/download_script.php? Src_id = 14376-O nginx. vim |
2. Add configuration ~ /. Vim/filetype. vim to the last line. If the file does not exist, create
The code is as follows: |
Copy code |
Vi ~ /. Vim/filetype. vim |
Add the following content:
The code is as follows: |
Copy code |
Au BufRead, BufNewFile/usr/local/nginx/* set ft = nginx |
The red path is your nginx. conf file path.
Auto Indent
Set Windows C/C ++ Auto Indent (add the following set statement to vimrc)
1) set the (soft) tab width to 4:
Set tabstop = 4
Set softtabstop = 4
2) set the number of spaces for indentation to 4.
Set shiftwidth = 4
3) set automatic indent: that is, the indent value of each line is equal to that of the previous line; use noautoindent to cancel the settings:
Set autoindent
4) set the automatic indent mode in C/C ++ language:
Set cindent
5) set the specific indent mode for C/C ++ language (taking my windows style as an example ):
Set cinoptions = {s, t0, n-2, p2s, (03 s, =. 5 s,> 1 s, = 1 s,: 1 s
6) to display the line number of the text on the left, use the following statement:
Set nu
Set roler set cursor display
7) add the following statement if it does not exist:
The code is as follows: |
Copy code |
If & term = "xterm" Set t_Co = 8 Set t_Sb = ^ [4% dm Set t_Sf = ^ [3% dm Endif |