Home >System Tutorial >LINUX >How to solve the problem of pressing the up, down, left and right keys to input ABCD in the vi editor in Ubuntu

How to solve the problem of pressing the up, down, left and right keys to input ABCD in the vi editor in Ubuntu

王林
王林forward
2024-01-16 13:21:161930browse

When using Ubuntu's vi editor, sometimes the up, down, left, and right keys turn into ABCD. Let me introduce the solution to this situation.

1. As shown in the figure, when using vi to edit the /etc/profile file, press the up, down, left and right keys in the editing state to change to ABCD.

How to solve the problem of pressing the up, down, left and right keys to input ABCD in the vi editor in Ubuntu

2. At this time, press Esc to exit the editing state, and then enter: q! to exit file editing.

How to solve the problem of pressing the up, down, left and right keys to input ABCD in the vi editor in Ubuntu

3. The reason for this problem is that there is a problem with the original vim-common component. You can solve this problem by uninstalling the original vim-common component and installing a new vim.

4. Use the command

after exiting file editing.

sudo apt-get remove vim-common

Uninstall the original vim-common component.

How to solve the problem of pressing the up, down, left and right keys to input ABCD in the vi editor in Ubuntu

5. After the uninstallation is complete, use the command

sudo apt-get install vim

Install vim.

How to solve the problem of pressing the up, down, left and right keys to input ABCD in the vi editor in Ubuntu

6. After the installation is complete, open the profile file for editing and return to normal.

How to solve the problem of pressing the up, down, left and right keys to input ABCD in the vi editor in Ubuntu

The above is the detailed content of How to solve the problem of pressing the up, down, left and right keys to input ABCD in the vi editor in Ubuntu. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:jb51.net. If there is any infringement, please contact admin@php.cn delete