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