ubuntu 新装后的vim版本为精简版的,用起来很不方便,用的配置文件是/etc/vim/vimrc.tiny。最好是新更新vim: sudo apt-get install vim
更新完后 vim用的配置文件为/etc/vim/vimrc
打开配置文件 sudo gedit /etc/vim/vimrc
加入下面的设置:
'tab为四个空格长度
set ts=4
'将tab替换成4个空格 这个最好设置一下,大家明白的
set expandtab
'自动缩进
set autoindent
'设置显示行号
set nu
'设置鼠标可用
set mouse=a
另外可以安装VIM插件,下面是我常用的插件,包括NERD_tree(文件列表),taglist(函数列表),word_complete(自动完成) ,cscope_maps.vim(cscope的VIM配置文件):
vimplugin.zip 解压后放在 ~/.vim/ 目录下
另外taglist需要安装ctags cscope_maps.vim需要安装cscope
附带记录一下SSH登陆配置,不用每次输入密码在 ~/.ssh 目录加建立config文件输入如下内容
ControlMaster auto
ControlPath /tmp/ssh_mux_%h_%p_%r
GSSAPIAuthentication no
阅读(436) | 评论(0) | 转发(0) |