1 execute pathogen#infect() 2 syntax on 3 set cindent " 使用 C/C++ 语言的自动缩进方式" 4 set cinoptions={ 0,1s,t0,n-2,p2s,(03s,=.5s,>1s,=1s,:1s "设置C/C++语言的具体缩进方式")} 5 set shiftwidth=4 " (自动) 缩进使用的4个空格" 6 set nu 7 set tabstop=4 8 set nobackup 9 set cursorline10 "set cursorcolumn11 set autoindent12 set ruler13 set mouse=a14 set showmatch15 highlight LineNr ctermfg=darkgreen16 highlight LineNr ctermbg=black17 18 "设置水平滚动条19 set guioptions+=b20 21 map:NERDTree 22 map :TlistToggle 23 map ggVG24 map! ggVG25 map gg=G26 vmap "+y27 28 let Tlist_Show_One_File=1 " 只展示一个文件的taglist29 let Tlist_Exit_OnlyWindow=1 " 当taglist是最后以个窗口时自动退出30 let Tlist_Use_Right_Window=1 " 在右边显示taglist窗口31 let Tlist_Sort_Type="name" " tag按名字排序32 33 filetype plugin indent on34 35 set completeopt=longest,menu36 let OmniCpp_NamespaceSearch = 2 " search namespaces in the current buffer and in included files37 let OmniCpp_ShowPrototypeInAbbr = 1 " 显示函数参数列表38 let OmniCpp_MayCompleteScope = 1 " 输入 :: 后自动补全39 let OmniCpp_DefaultNamespaces = ["std", "_GLIBCXX_STD"]40 41 set tags+=~/.vim/tags/cpp_src/tags42 43 nnoremap :w :!g++ -std=c++11 % -o /tmp/a.out && /tmp/a.out 44 nnoremap :w :!g++ -std=c++11 % 45 nnoremap :w :!g++ -std=c++11 -g % -o /tmp/a.out && gdb /tmp/a.out 46 47 imap { } O 48 map :call SetTitle() 49 func SetTitle()50 let l = 051 let l = l + 1 | call setline(l, '#include ')52 let l = l + 1 | call setline(l, '#include ')53 let l = l + 1 | call setline(l, '#include ')54 let l = l + 1 | call setline(l, '')55 let l = l + 1 | call setline(l, 'using namespace std;')56 let l = l + 1 | call setline(l, '')57 let l = l + 1 | call setline(l, 'int main()')58 let l = l + 1 | call setline(l, '{ ')59 let l = l + 1 | call setline(l, '')60 let l = l + 1 | call setline(l, ' return 0;')61 let l = l + 1 | call setline(l, '}')62 endfunc63 64 "powerline{ 65 "set guifont=PowerlineSymbols\ for\ Powerline66 "set nocompatible67 "set t_Co=09968 "let g:Powerline_symbols='fancy'69 "}70 71 set rtp+={repository_root}/powerline/bindings/vim