晒出自己的.vimrc配置

来源:互联网 发布:梦幻西游 mac 卸载 编辑:程序博客网 时间:2024/04/28 17:09

最近爱上了vim, 喜欢它超灵活的扩展性。以下是我的.vimrc配置文件:


:let mapleader = "," set nuset ts=4 sw=4 expandtab smartindent nohlsearch number incsearch showmatchset bs=2set laststatus=2"set cursorlineset autoreadnmap <leader>a :set mouse=a<CR>nmap <leader>d :set mouse=<CR>nmap <F9> :source ~/.vimrc<CR>nmap <leader>fn :echo expand('%')<CR>"set foldmethod=syntaxnmap <C-Tab> <C-K><Tab>call pathogen#infect()set path = "./"set path += "/usr/include/c++""ctags={set tags+=./tagsset tags+=~/.vim/tags/cpp" build tags of your own project with Ctrl-F12map <C-F12> :!ctags -R --sort=yes --c++-kinds=+p --fields=+iaS --extra=+q .<CR>"}"supertab{let g:SuperTabRetainCompletionType=2let g:SuperTabDefaultCompletionType="<C-X><C-O>""}""winmanager{let g:winManagerWindowLayout='FileExplorer|TagList'nmap wm :WMToggle<cr>"}"powerline{set guifont=PowerlineSymbols\ for\ Powerlineset nocompatibleset t_Co=256let g:Powerline_symbols = 'fancy'"}"minibufexplorer{let g:miniBufExplMapWindowNavVim = 1let g:miniBufExplMapWindowNavArrows = 1let g:miniBufExplMapCTabSwitchBufs = 1let g:miniBufExplModSelTarget = 1noremap <silent> <leader>f :call <SID>CycleBuffer(1)<CR>:<BS>noremap <silent> <leader>f :call <SID>CycleBuffer(0)<CR>:<BS>"}"taglist{let Tlist_Show_One_File = 1let Tlist_Exit_OnlyWindow = 1let Tlist_Auto_Open = 0nmap <F7> :Tlist<CR>"}"cscope{:set cscopequickfix=s-,g-,c-,d-,i-,t-,e-:set nocscopeverbose" build tags of your own project with Ctrl-F12map <C-F11> :!cscope -Rbq -s . -f cscope.out<CR>if filereadable("./cscope.out"):cs add ./cscope.outendif"Find this C symbolnmap <C-\>s :cs find s <C-R>=expand("<cword>")<CR><CR>"Find this definitionnmap <C-\>g :cs find g <C-R>=expand("<cword>")<CR><CR>"Find functions calling this functionnmap <C-\>c :cs find c <C-R>=expand("<cword>")<CR><CR>"Find assignments tonmap <C-\>t :cs find t <C-R>=expand("<cword>")<CR><CR>"Find this egrep patternnmap <C-\>e :cs find e <C-R>=expand("<cword>")<CR><CR>"Find this filenmap <C-\>f :cs find f <C-R>=expand("<cfile>")<CR><CR>"Find files #including this filenmap <C-\>i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR>"Find functions called by this functionnmap <C-\>d :cs find d <C-R>=expand("<cword>")<CR><CR>"}"tagbar{nmap <F12> :TagbarToggle<CR>let g:tagbar_width = 22"}""OmniCppComplete{set nocpfiletype plugin on" OmniCppCompletelet OmniCpp_NamespaceSearch = 1let OmniCpp_GlobalScopeSearch = 1let OmniCpp_ShowAccess = 1let OmniCpp_ShowPrototypeInAbbr = 1 " show function parameterslet OmniCpp_MayCompleteDot = 1 " autocomplete after .let OmniCpp_MayCompleteArrow = 1 " autocomplete after ->let OmniCpp_MayCompleteScope = 1 " autocomplete after ::let OmniCpp_DefaultNamespaces = ["std", "_GLIBCXX_STD"]" automatically open and close the popup menu / preview windowau CursorMovedI,InsertLeave * if pumvisible() == 0|silent! pclose|endifset completeopt=menuone,menu,longest,preview"}"a{nnoremap <silent> <F4> :A<CR>"}""NERDTree{nnoremap <silent> <F2> :NERDTreeToggle<CR>nnoremap <silent> <C-t><C-f> :NERDTreeFind<CR>"}""Grep{nnoremap <silent> <F3> :Rgrep<CR>"}"}"SuperTab{let g:SuperTabRetainCompletionType=2let g:SuperTabDefaultCompletionType="<C-X><C-O>""}"LookupFile{map <C-F10> :!makelookuptag.sh<CR>:let g:LookupFile_TagExpr ='"./filenametags_lookupfile"'<CR>nnoremap <silent> <leader>lf :LookupFile<CR>"nnoremap <silent> <leader>lw :LUWalk<CR> "this function is not better than ,fd in FuzzyFinder"nnoremap <silent> <leader>lp :LUPath<CR>nnoremap <silent> <leader>lb :LUBufs<CR>let g:LookupFile_MinPatLength = 2let g:LookupFile_PreserveLastPattern = 0let g:LookupFile_PreservePatternHistory = 1let g:LookupFile_AlwaysAcceptFirst = 1let g:LookupFile_AllowNewFiles = 0let g:LookupFile_ignorecase = 1let g:LookupFile_smartcase = 1let g:LookupFile_SortMethod = ""if filereadable("./filenametags_lookupfile")let g:LookupFile_TagExpr ='"./filenametags_lookupfile"'endif"}"FuzzyFinder{"nnoremap <silent> <leader>ff :FufFile<CR>nnoremap <silent> <leader>fd :FufDir<CR>"}"ctrlp{let g:ctrlp_cmd = 'CtrlP'set wildignore+=*/Build-vc90/*,*.o,*.exe,*.git,*.pdb,*.bak,*.so,*.alet g:ctrlp_by_filename = 1 " only lookup file namelet g:ctrlp_max_height = 15let g:ctrlp_clear_cache_on_exit = 0let g:ctrlp_cache_dir = $HOME.'/.ctrlp/cache/'let g:ctrlp_working_path_mode = 'ra'let g:ctrlp_custom_ignore = {    \ 'dir':  '\v[\/]\.(git|hg|svn)$',    \ 'file': '\v\.(exe|so|dll|bak|gds)$',    \ 'link': 'SOME_BAD_SYMBOLIC_LINKS',    \ }"let g:ctrlp_user_command = 'find %s -type f | grep -P "\.pl$|\.py$|\.lua$|\.xml$|\.sh$|\.mk$|\.h$|\.hh$|\.hpp$|\.c$|\.cc$|\.cpp$"'"}


安装的插件如下:

~/.vim
├── autoload
│   └── pathogen.vim
├── bundle
│   ├── a
│   ├── clang_complete
│   ├── ctrlp
│   ├── fuzzyfinder
│   ├── genutils
│   ├── grep
│   ├── l9
│   ├── lookupfile
│   ├── minibufexpl
│   ├── nerdtree
│   ├── supertab
│   ├── tagbar
│   ├── taglist
│   ├── vim-powerline
│   └── winmanager
└── tags
    ├── cpp
    └── cpp_src

原创粉丝点击