Linux use VI when the direction key to garbled, delete keys can not be used to solve the method (pro-test effective) __linux

Source: Internet
Author: User
Tags delete key

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.

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.