CentOS system, modify the Vim profile/ETC/VIMRC add the following: 1) open VIMRC, add the following statement to make syntax highlighting: syntax on2) If the syntax is still not highlighted, then in the/etc directory Add the following statement to the profile file: Export Term=xterm-color3) Resolve the problem of the key and backspace key invalidation (in non-compatible mode) set Nocompatibleset backspace=24, setting the Windows-style + + Auto Indent (add the following set statement to VIMRC) 1) Set (soft) tab width to 4:set tabstop=4set softtabstop=42) set indent to 4set shiftwidth=43) Set auto indent: The indent value for each line is equal to the previous line, and the noautoindent setting : Set Autoindent4) sets the automatic indentation using the C + + language: Set CINDENT5) Language specific indentation: Set Cinoptions={0,1s,t0,n-2,p2s, (03S,=.5S,>1S,=1S,:1S6) if you want to display the line number of text on the left, you can use the following statement: Set NU7) Finally, if there is no following statement, Just add it: if &term== "xterm" set t_co=8
Various tips for VIM