我使用 ubuntu 自带的vi 编辑器 感觉超难使用,解决方法如下:
1 卸掉旧版的vi,输入以下命令: sudo apt-get remove vim-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
ubuntu-minimal vim-common vim-tiny
0 upgraded, 0 newly installed, 3 to remove and 321 not upgraded.
After this operation, 1,212 kB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 155432 files and directories currently installed.)
Removing ubuntu-minimal ...
Removing vim-tiny ...
update-alternatives: using /usr/bin/see to provide /usr/bin/view (view) in auto mode
Removing vim-common ...
Processing triggers for mime-support ...
Processing triggers for man-db ...
ok ,成功删除。
2 安装 新版本的vim sudo apt-get install vim
aries@ubuntu:~$ sudo apt-get install vim
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
vim-common vim-runtime
Suggested packages:
ctags vim-doc vim-scripts
The following NEW packages will be installed:
vim vim-common vim-runtime
0 upgraded, 3 newly installed, 0 to remove and 321 not upgraded.
Need to get 5,508 kB of archives.
After this operation, 25.3 MB of additional disk space will be used.
Do you want to continue [Y/n]? y //安装
ok ! 完了以后 vi 使用起来感觉都不一样!
3 编辑/etc/vim/vimrc.tiny
由于/etc/vim/vimrc.tiny的拥有者是root用户,所以要在root的权限下对这个文件进行修改。很简单,这个文件里面的倒数第二句话是“set compatible”,将“compatible”改成“nocompatible”非兼容模式就可以解决方向键变ABCD的问题了。