"设置自动缩进:即每行的缩进值与上一行相等;使用 noautoindent 取消设置: set autoindent
"设置使用 C/C++ 语言的自动缩进方式: set cindent
"设置C/C++语言的具体缩进方式(以我的windows风格为例): set cinoptions={0,1s,t0,n-2,p2s,(03s,=.5s,>1s,=1s,:1s
"如果想在左侧显示文本的行号,可以用以下语句: set nu
"最后,如果没有下列语句,就加上吧: if &term=="xterm" set t_Co=8 set t_Sb=^[[4%dm set t_Sf=^[[3%dm endif
"taglist 插件Ctags 插件: TagList let Tlist_Show_One_File=1 let Tlist_Exit_OnlyWindow=1
"文件浏览器和窗口管理器 -- 插件: WinManager let g:winManagerWindowLayout='FileExplorer|TagList' nmap wm :WMToggle
" tags "set tags=./tags
"是否使用 quickfix 窗口来显示 cscope 结果 set cscopequickfix=s-,c-,d-,i-,t-,e-
"映射cscope键盘 nmap s :cs find s =expand("") nmap g :cs find g =expand("") nmap c :cs find c =expand("") nmap t :cs find t =expand("") nmap e :cs find e =expand("") nmap f :cs find f =expand("") nmap i :cs find i =expand("") nmap d :cs find d =expand("")
"快速浏览和操作Buffer -- 插件: MiniBufExplorer "以下的两个功能需要在~/.vimrc中增加: let g:miniBufExplMapCTabSwitchBufs = 1" 向前循环切换到每个buffer上,并在但前窗口打开 " 向后循环切换到每个buffer上,并在但前窗口打开 "如果在~/.vimrc中设置了下面这句: let g:miniBufExplMapWindowNavVim = 1"则可以用切换到上下左右的窗口中去,就像: "C-w,h j k l 向"左,下,上,右"切换窗口. "在~/.vimrc中设置: let g:miniBufExplMapWindowNavArrows = 1"是用切换到上下左右窗口中去
"c/h文件间相互切换 -- 插件: A nnoremap :A"意思是按F12时在一个新的buffer中打开c\h文件,
"在工程中查找 -- 插件: Grep nnoremap :Grep"在想查的词上按F3
"c智能补全 filetype plugin indent on"打开文件类型检测, 加了这句才可以用智能补全 set completeopt=longest,menu"关掉智能补全时的预览窗口
"加速你的补全 -- 插件: SuperTab let g:SuperTabRetainCompletionType=2"设置按下后默认的补全方式 let g:SuperTabDefaultCompletionType=""" 2 - 记住上次的补全方式,直到按ESC退出插入模式为止
"关闭了VI兼容模式,并允许进行文件类型检测 插件OmniCppComplete: "c++补全ctag命令 ctags -R --c++-kinds=+p --fields=+iaS --extra=+q src set nocp filetype plugin on
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 用到高亮的书签 -- 插件: VisualMark的时候总是报错 E197不能设置语言 en_US之类的。 看help google好久 无解 最后进其插件源码看到有设置语言的一段注释“" Set the language to English” 连忙 $locale -a 把下面代码 exec ":lan mes en_US"改为 exec ":lan mes en_US.utf8"问题得以解决。