First, the editor/etc/vim/vimrc.tiny
Since the owner of the/etc/vim/vimrc.tiny is the root user, the file must be modified under root privileges. Very simply, the penultimate sentence in this file is "set compatible", as follows:
Changing the "compatible" to "nocompatible" non-compatible mode solves the problem of the direction key becoming ABCD. The next problem to solve the backspace key is also very simple, in the sentence after just add a sentence:
- Set backspace=2
becomes as shown:
can solve the problem. This time, regardless of which user, the use of VI can be very convenient according to our custom to edit the file.
Second, the installation of Vim full version
Since Ubuntu preinstalled is the tiny version, it will cause us to use the above inconvenience caused. However, after we have installed the full version of Vim, all keys on the keyboard are normal under VI.
First, to remove the old version of VI, enter the following command:
- sudo apt-get remove Vim-common
Then install the full version of VIM and enter the command:
- sudo apt-get install vim
After this installation, we still use the "VI" command to start the newly installed VIM when editing the file, but it is more convenient to operate than the tiny.
Third, add ". VIMRC" File
It's not a clever way. It is in the user's personal directory, edit the. vimrc file (Note that the file name is ".") ), add the following two sentences:
- Set nocompatible //working in non-compatible mode
- Set backspace=2
As shown in the following:
After saving the exit, the user will be able to use VI in the future to avoid the keyboard direction keys and backspace key invalid problem.
It's not a smart idea because we have to add the ". VIMRC" file to each user in their personal directory, so that all users can use the VI function properly, which is a relatively large amount of work. So it is not recommended, even though I myself initially solved this method (because there are only 2 users on my system, less).
Under Ubuntu use VI is the direction key garbled backspace key cannot use the solution