1
Install vimlupa open-source community 0i; mendf
Sudo apt-Get install vim-full
P h'u-] + y ^ 151392
2
, Configuration file location
In the Directory
/Etc/Vim
Below, there is
Vimrc
File, which is public in the system
Vim
Configuration file, which is valid for all users.
3
Set syntax highlighting
1)
Open
Vimrc
To highlight the Syntax:
Syntax on
2)
If the syntax is still not highlighted
/Etc
Directory
Profile
Add the following statement to the file:
Export term = xterm-color
4
, Settings
Windows
Style
C/C ++
Auto indent (Add the following
Set
Statement
Vimrc
Medium)
1
)
Set the (soft) tab width
4
:
Set tabstop = 4
Set softtabstop = 4
2
)
Set the number of spaces for indentation.
4
Set shiftwidth = 4
3
)
Set automatic indent
: The indentation value of each line is equal to that of the previous line.
Noautoindent
Unset:
Set autoindent
4
)
Set
Use
C/C ++
Automatic language indentation:
Set cindent
5
) Settings
C/C ++
Specific language indentation
:
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
7
) Finally, if the following statements are not available, add them:
If & term = "xterm"
Set t_co = 8
Set t_sb = ^ [4% DM
Set t_sf = ^ [3% DM
Endif
The above content is found on the internet, but there are some inconsistencies with Ubuntu, for example, the original search said vimrc is under the/etc directory, however, in Ubuntu (at least in Ubuntu 9.04), it is in/etc/vim. So I changed it.