Solution to the VIM syntax highlighting does not work _linux

Source: Internet
Author: User

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

# echo $TERM   

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.