[Objective]
SuSE connected through securecrt. Vim is installed in the server, but its current terminal does not display the color when editing text files using Vim. Therefore, the purpose is to add the color, enable syntax highlighting
[Methods and precautions]
1. add your own configuration file
It indicates that the vim color is not displayed because the syntax highlighting function is not enabled and necessary settings are required.
For Vim, the global configuration is in/etc/vimrc, which is effective for all users. Here, I just want to use Vim to use my own configuration, syntax highlighting, and other functions, so I can add or edit my vim configuration file under the root directory of my current user.
In the root directory of your own user, edit a configuration file named. vimrc under/home/your_name (if not, create it yourself ):
# Vi ~ /. Vimrc
Then, add the corresponding configuration code. The configuration code is provided by many people on the Internet. If you just want to use it easily, you can paste the following content directly:
"============================================== ========
"General settings
"============================================== ========
Set nocp
Set Ru
Set nu
"Set CIN
"Set cino =: 0366t0 (Sus
Set Sm
Set AI
Set Sw = 4
Set Ts = 4
Set NOET
Set LBR
Set HLS
"Set backspace = indent, EOL, start
"Set whichwrap = B, S, [,]
"Set fo + = MB
Set selectmode =
"Set mousemodel = popup
Set keymodel =
"Set selection = random sive
"Set matchpairs + =
Syntax on
Set hlsearch
Highlight search term = reverse ctermbg = 4 ctermfg = 7
Highlight normal ctermbg = black ctermfg = white
Highlight comment ctermfg = blue
Set CIN
"Colo Ron
"Filetype on
Then exit and save.
2. Set securecrt as needed
(1) For securecrt: Options-> session options-> terminal-> in emulation, select ANSI, Linux, or xterm. Be sure to hook ANSI colour on the right, otherwise, if xterm is selected, it is not selected by default. It is displayed in black, white, and ugly...
(2) Note: If I use securecrt and want to make the configuration take effect immediately, I need to disconnect the reconnect server and then use Vim to open and edit the text to see the effect:
Open a c file. The effect is as follows:
3. For more configurations, the specific meaning of extreme options
Many posts on the internet, I think these are useful and clear:
Explanation: (reprinted, read) Vim configuration file. vimrc
Http://blog.chinaunix.net/u2/66983/showart_576157.html
A configuration file in full English:
Vim configuration file (. vimrc)
Http://www.slackorama.com/projects/vim/vimrc.html
A more detailed English configuration with instructions: example. vimrc
Http://www.vi-improved.org/vimrc.php
[References]
1. Use securecrt to set the color of Linux Vim [available. vimrc file content]
Http://blog.csdn.net/kennylee26/archive/2009/02/27/3942229.aspx
2. Configure the vim. vimrc File
Http://www.kmznit.cn/zn/ShowArchive.php? Archiveid = 77