Using VI is a solution that cannot be used when the direction keys become garbled.

Source: Internet
Author: User

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 penultimate sentence in this file is "set compatible", as shown below:

Change "compatible" to "nocompatible" to incompatible mode to solve the problem of changing the direction key to ABCD. Next, we need to solve the problem of the backspace key, which is also very simple. In the previous sentence, we will add one more sentence:

 

[CPP] View plaincopy
    1. Set backspace = 2

As shown in the following figure:

 

You can solve the problem. At this time, no matter which user, Vi can easily edit files according to our habits.

Ii. Install Vim full

Because ubuntu is pre-installed with the tiny version, it will cause the above inconvenience in use. However, after the vim full version is installed, all the keys on the keyboard are normal under VI.

First, uninstall the earlier version of VI and enter the following command:

[CPP] View plaincopy
    1. Sudo apt-Get remove vim-common

Run the following command to install Vim of Full Edition:

[CPP] View plaincopy
    1. Sudo apt-Get install Vim

After the installation, we still use the "Vi" command to start the newly installed Vim when editing the file, but the operation is more convenient than Tiny.

 

3. Add the ". vimrc" File

This is not a clever method. In the user's personal directory, edit the. vimrc file (note that the file name starts with ".") and add the following two statements:

 

[CPP] View plaincopy
    1. Set nocompatible // works in incompatible Mode
    2. Set backspace = 2

As shown in:

 

After saving and exiting, you can use VI to avoid invalid keyboard direction keys and backspace keys.

It is not a clever method because we have to add ". in order to make all users use the VI function normally, this is a relatively large workload. Therefore, it is not recommended, although I initially used this solution (because there are only two users in my system, which is relatively small ).

Using VI is a solution that cannot be used when the direction keys become garbled.

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.