删除linux自带VIM 从新安装

卸载Vim GVIM
普通安装方式卸载
sudo apt-get remove –purge vim (–purge 是彻底删除,会连配置文件一块儿删除)
sudo apt-get remove –purge vim-gtk vim-doc cscope
sudo apt-get cleanjavascript

安装Vim GVIM
普通方式安装
sudo apt-get install vim
sudo apt-get install vim-gtk vim-doc cscopephp

开始配置vim
Linux 下 vim 默认配置文件 /etc/vim/vimrc
用户默认配置文件 ~/.vimrc
若是想一次配置,全部用户都能使用,那就修改 /etc/vim/vimrc,若是只想当前用户可使用,则修改 ~/.vimrc
针对开发配置
au FileType php,c,java,javascript,html,htm,smarty call SetOption()
function! SetOption()
set expandtab ” 使用空格代替tab
set shiftwidth=4 ” 设定 << 和 >> 命令移动时的宽度为 4
set tabstop=4 ” 用4个空格代替1个tab
set sts=4 ” 设置softtabstop 为 4,输入tab后就跳了4格.
set cindent ” C语言方式缩进
set smartindent ” 智能缩进
set autoindent ” 自动缩进
set smarttab ” 只在行首用tab,其余地方的tab都用空格代替
set showmatch ” 在输入括号时光标会短暂地跳到与之相匹配的括号处
” set fdm=indent ” 代码折叠
set lbr
set tw=500
set wrap ” 自动换行
endfunctionhtml

还有就是遇到了一个问题:
* (gvim:2581): WARNING **: Unable to register window with path ‘/com/canonical /foo/3C00024’: Timeout was reachedjava

解决方案是
It means the menus (File, Edit, Tools, Syntax, Buffers, Window, Help) will not be displayed on hovering at the top of the screen when the gvim window is the active window.
It is a bug and has a work around.
gvim(){ /usr/bin/gvim -f “$@” & true; }web

ref: http://blog.sina.com.cn/s/blog_80dee3b701011bid.htmlvim