CentOS7 root user, general user switching vim and vi

CentOS7 root user, general user switching vim and vi

Problems encountered

Vi and vim in CentOS7 there are two kinds of editors, vim is fully functional, vi is equivalent VIm version of castration, there will be some small problems vi unpleasant to use. For example: When using VI, appears in edit mode, press the up, down, left, right arise where A, B, C, D letters; another example, also in the use of VI, in edit mode, delete the spacebar the problem can not be used. When using vim the above problem does not arise.

Solution (ordinary users)

Among CentOS 7, due to the general account default vi vim has been replaced, and therefore have to enter an absolute path to execute the job!

vi vim and location in the system

Compare vi text editor vim and ordinary users

vi text editor

Use ordinary users need to enter vi vi absolute path

vim text editor

Among CentOS 7, due to the general account preset vi vim been replaced, use the same correlation of vi and vim

root user Solution

Comparison of vi and vim text editor as root user

vi text editor

The default root user to use when using the vi command emasculated version of vim

vim text editor

Use vim can avoid many errors in the root user, it is recommended to use vim in the root user

Guess you like

Origin www.cnblogs.com/xiaoyuzhou55/p/11955174.html