The direction keys are garbled when vi is used in ubuntu. The backspace key cannot be used. ubuntuvi

Source: Internet
Author: User

The direction keys are garbled when vi is used in ubuntu. The backspace key cannot be used. ubuntuvi

The direction keys are garbled when vi is used in ubuntu. The return key cannot be used.

Problem: In Ubuntu, when vi is initially used and the direction keys are used in editing mode, the cursor does not move, but a B C D or other letters appear in the command line, in addition, the backspace cannot be used even if an editing error occurs. You can only delete the backspace by using delete.

Solution:

First use sudo apt-get install vim

1. edit/etc/vim/vimrc. tiny

Because the owner of/etc/vim/vimrc. tiny is the root user, you must modify the file with the root permission. The last sentence in this file is set compatible, as shown below:

Changing compatible to nocompatible in incompatible mode can solve the problem of changing the direction key to ABCD. Next, solve the problem that the backspace key cannot be used. Add a set backspace = 2 following the sentence just now, as shown below:

 

At this time, the problem has been solved. No matter which user, using vi can easily edit the file according to our habits.

Ii. Install vim full

Ubuntu is pre-installed with the tiny version, which may cause the above inconvenience during use. However, after we install the full version of vim, the key of the keyboard is normal under vi.

Solution:
Uninstall tiny sudo apt-get remove vim-common
Install full sudo apt-get install vim

 

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.