1 execute pathogen#infect() 2 syntax on 3 "colorscheme slate 4 filetype plugin indent on 5 "syn keyword a cin cout endl 6 "hi a guifg=#8DA5ED 7 8 9 highlight LineNr ctermbg=black 10 highlight LineNr ctermfg=darkgreen 11 12 set cindent " 使用 C/C++ 语言的自动缩进方式" 13 set cinoptions={0,1s,t0,n-2,p2s,(03s,=.5s,>1s,=1s,:1s "设置C/C++语言的具体缩进方式")} 14 set shiftwidth=4 " (自动) 缩进使用的4个空格" 15 set nu 16 set tabstop=4 17 set nobackup 18 set cursorline 19 "set cursorcolumn 20 set autoindent 21 set ruler 22 set mouse=a 23 set showmatch 24 25 map <C-n> :NERDTree<CR> 26 map <C-t> :TlistToggle<CR> 27 map <C-A> ggVG 28 map! <C-A> <Esc>ggVG 29 map <F12> gg=G 30 vmap <C-c> "+y 31 32 let Tlist_Show_One_File=1 " 只展示一个文件的taglist 33 let Tlist_Exit_OnlyWindow=1 " 当taglist是最后以个窗口时自动退出 34 let Tlist_Use_Right_Window=1 " 在右边显示taglist窗口 35 let Tlist_Sort_Type="name" " tag按名字排序 36 37 filetype plugin indent on 38 set completeopt=longest,menu 39 let OmniCpp_NamespaceSearch = 2 " search namespaces in the current buffer and in included files 40 let OmniCpp_ShowPrototypeInAbbr = 1 " 显示函数参数列表 41 let OmniCpp_MayCompleteScope = 1 " 输入 :: 后自动补全 42 let OmniCpp_DefaultNamespaces = ["std", "_GLIBCXX_STD"] 43 44 set tags+=~/.vim/tags/cpp_src/tags 45 46 nnoremap <F9> <Esc>:w<CR>:!g++ -std=c++11 % -o /tmp/a.out && /tmp/a.out<CR> 47 nnoremap <C-F9> <Esc>:w<CR>:!g++ -std=c++11 %<CR> 48 nnoremap <F8> <Esc>:w<CR>:!g++ -std=c++11 -g % -o /tmp/a.out && gdb /tmp/a.out<CR>
时间: 2024-10-07 07:05:53