Under Ubuntu use VI is the direction key garbled backspace key cannot use the solution

Source: Internet
Author: User

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:

    1. 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:

    1. sudo apt-get remove Vim-common

Then install the full version of VIM and enter the command:

    1. 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:

    1. Set nocompatible //working in non-compatible mode
    2. 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

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.