First, vim updates to the latest version yum -y install vim
, and install Vim's enhanced version vim-enhanced
to install support color componentsyum -y install vim-enhanced
Second, configure the Vim configuration file to vi /etc/vimrc
add a rowsyntax on
Or we could simply download a clean version of VIMRC.
Third, in order to make the VI command can also use Vim configuration, need to modify the vi /etc/bashrc
add line alias vi='vim'
At this point, the syntax highlighting can already be displayed through the above configuration.
If the cup has happened to you, after the above configuration or no syntax highlighting, then do not lose heart, you need to check from the following:
The first step is to check the $term variable
If the output is not xterm-color
, then you need to set it manually. Add a line to the end of the/etc/profile file export $TERM=xterm-color
and make the changes take effect # source /etc/profile
At this point, check again, if there is no syntax highlighting, then the second step
The second step, if you are using a remote login, such as SECURECRT, you need to set
Session options > Terminal > Emulation, select Xterm in the next menu, and hook ANSI color, and choose color scheme depending on your needs
At this point, the basic will appear syntax highlighting.
Summarize
The above is the entire content of this article, I hope the content of this article for everyone to learn or operate VIM can help, if you have questions you can message exchange.