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

Source: Internet
Author: User

The teacher assigned each of us an Ubuntu virtual machine, said to do the experiment. I certainly do not mind, my favorite is Ubuntu, but for some of the unfamiliar to Linux students, may be a very difficult experimental process.

The teacher wants us to edit some files under Ubuntu, which involves the VI editor. In Ubuntu, the initial use of the VI is a problem, that is, when using the arrow keys in edit mode, does not make the cursor move, but in the command line appears [A [B] [C [d] letters, and editing errors, even the usual about the backspace (backspace key) can not be used, can only be deleted with delete. In response to this question, there are many online answers, such as the installation of the full version of Vim Ah, editing/etc/vim/vimrc.tiny and other methods, very miscellaneous very messy, here I will do a detailed summary of it:

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:

Hint: There is no space on either side of the equals sign in set backspace=2 here

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.

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.