1:因为习惯了vim和gvim,前篇学习笔记1,解决了gvim的和gedit的环境,但是直接在控制台vim的时候会报错.
具体就是
root@debian:/home/rainysia/www# cat test.txt
root@debian:/home/rainysia/www# vim test.txt
Error detected while processing /usr/share/vim/vimrc:
line 68:
E484: Can't open file /usr/share/vim/delmenu.vim
line 69:
E484: Can't open file /usr/share/vim/menu.vim
line 110:
E185: Cannot find color scheme desert
line 119:
E484: Can't open file /usr/share/vim/syntax/syntax.vim
line 120:
E484: Can't open file /usr/share/vim/syntax/syntax.vim
line 299:
E484: Can't open file /usr/share/vim/syntax/php.vim
Press ENTER or type command to continue
想起来/usr/share/vim是没有插件这些的,都在/usr/share/vim/vim72下面
vi打开.vimrc,输入/VIMRUNTIME,发现
root@debian:/usr/share/vim# vi .vimrc
source $VIMRUNTIME/delmenu.vim
source $VIMRUNTIME/menu.vim
正好是报错的几个,于是回到控制他
:q
root@debian:/usr/share/vim# echo $VIMRUNTIME
输出为空白一行 没有环境变量.
于是重新vi vimrc
root@debian:/usr/share/vim# vi .vimrc
在最上面加入这两行
let $VIMRUNTIME="/usr/share/vim/vim72"
set runtimepath=/usr/share/vim/vim72
要是如果你是vim73,改成73就可以来.
然后
:wq
回到控制台再打开就发现vim vi不会报错了