Linux switch to root user under VI syntax highlighting is not successful

Source: Internet
Author: User


When configuring VI, the general user will display syntax highlighting, but switching to root user highlighting is always unsuccessful, what is the reason? (Redhat)

originally for the general user, when we look at the command aliases we find VI = VIM

< Span style= "font-family: ' Microsoft Jas Black ', ' Microsoft Yahei '; font-size:18px;" > [[email protected] ~]$ which VI
alias vi= ' vim '

/usr/bin/vim


for Root, this alias is not defined by default. so VI is VI, not vim.

[email protected] robin]# which VI
/bin/vi


VI without this function, VIM has the function of syntax highlighting.

Knowing the cause of the problem is a good solution, you can use the alias command to define the VI alias as VIM, as follows:

Alias Vi= ' Vim '


However, the alias is deleted after exiting the login, and one way to make the alias permanent is to Zengzenga a line in Bash's configuration file ~/.BASHRC

Alias Vi= ' Vim '

When the bash user logs on to bash, the profile is read to define the alias for the VI vim


Linux switch to root user under VI syntax highlighting is not successful

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.