Syntax highlighting settings
The Linux system under the Vim or VI editor defaults to nginx syntax highlighting.
You need to manually configure it yourself.
1. Download VI syntax highlight configuration to ~/.vim/syntax, if not present, create the directory
The code is as follows |
|
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 and create if the file does not exist
The code is as follows |
|
VI ~/.vim/filetype.vim |
Add the following content:
The code is as follows |
|
Au bufread,bufnewfile/usr/local/nginx/* set Ft=nginx |
Where the red path is your nginx.conf file path
Auto Indent
Set Windows-style C + + automatic indentation (add the following set statement to VIMRC)
1) Set (soft) tab width to 4:
Set tabstop=4
Set softtabstop=4
2) Set the number of spaces indented to 4
Set shiftwidth=4
3 Set Auto indent: That is, the indentation value of each row is equal to the previous line; Use Noautoindent to cancel the setting:
Set Autoindent
4 to set up the automatic indent mode using C + + language:
Set Cindent
5 to set the specific indentation method for A/C + + language (for example, my Windows style):
Set Cinoptions={0,1s,t0,n-2,p2s, (03s,=.5s,>1s,=1s,:1s
6 If you want to display the line number of the text on the left, you can use the following statement:
Set Nu
Set Roler setting cursor display
7 Finally, if you don't have the following statement, add it:
code is as follows |
&nbs P; |
if &term== "xterm" Set t_co=8 ; set T_SB=^[[4%DM set T_SF=^[[3%DM endif |