Edit some files under Linux, which involves the VI editor. Under Linux, the initial use of VI has two typical problems:
1, in the editing mode when using the arrow keys, and will not make the cursor movement, but in the command line appears a, B, C, d four letters;
2, when the editor error, want to delete, found backspace key does not work, can only use the DELETE key to remove;
These two questions are very annoying to the novice, below I will give everybody to say one kind from the net to get and I also the vital effective method.
First, edit/etc/vim/vimrc.tiny
Since the owner of the/etc/vim/vimrc.tiny is the root user, the file should be modified with root permissions. The method is simple: You can enter the command "su", then type the password to get root, and then modify the file, or enter the command "sudo vi/etc/vim/vimrc.tiny", and enter the password to edit the file directly.
The editorial content is also super simple: The penultimate sentence in the Vimrc.tiny file is "set compatible", as shown in the following figure:
Change "compatible" to "nocompatible", so that incompatible mode can solve the problem of the direction key to ABCD. Then to solve the problem of the BACKSPACE key is very simple, just after that sentence add a sentence:
Set backspace=2
As shown in the following illustration:
This can solve the problem, this time, no matter for which user, can be very convenient according to our habits to edit the file.