- 论坛徽章:
- 0
|
把.vimrc再贴出来,里面有很多没有注释,在网上可以查到含义,我这里就不多说了- set nocp
- set tabstop=4
- set softtabstop=4
- set shiftwidth=4
- set autoindent
- set autowrite
- set hidden
- set cindent
- set cinoptions={0,1s,t0,n-2,p2s,(03s,=.5s,>1s,=1s,:1s
- set nu
- "set mouse=a
- set cscopequickfix=s-,c-,d-,i-,t-,e-
- syntax enable
- syntax on
- "show cur file name
- set statusline+=%f
- set ruler
- "光标在窗口上下边界时距离边界7行即开始滚屏
- set so=7
- "显示匹配括号
- set showmatch
- "high light
- set hlsearch
- "auto fold
- set fdm=syntax
- set nofen
- "
- " 在搜索的时候忽略大小写
- set ignorecase
- "set bg=dark
- "colorscheme darkblue_my
- "colorscheme desertEx_my
- colorscheme vc_my
- "highlight Functions
- syn match cFuntions display "[a-zA-Z_]\{-1,}\s\{-0,}(\{1}"ms=s,me=e-1
- "hi def link cFuntions Title
- "autosave
- "au VimLeave * mksession! ~/.vim/session/workspace.session
- "au VimLeave * wviminfo! ~/.vim/session/workspace.viminfo
- "taglist
- let Tlist_Show_One_File=1
- let Tlist_Exit_OnlyWindow=1
- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
- " cscope setting
- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
- if has("cscope")
- set csprg=/usr/bin/cscope
- set csto=1
- set cst
- set nocsverb
- "add any database in current directory
- if filereadable("cscope.out")
- cs add cscope.out
- endif
- set csverb
- endif
- if filereadable("tags")
- set tags+=tags
- endif
- if filereadable("~/.vim/tags/cpp")
- set tags+=~/.vim/tags/cpp
- endif
- nmap <C-\>g :cs find g <C-R>=expand("<cword>")<CR><CR>
- nmap <C-\>c :cs find c <C-R>=expand("<cword>")<CR><CR>
- nmap <C-\>s :cs find s <C-R>=expand("<cword>")<CR><CR>
- nmap <C-\>t :cs find t <C-R>=expand("<cword>")<CR><CR>
- nmap <C-\>e :cs find e <C-R>=expand("<cword>")<CR><CR>
- nmap <C-\>f :cs find f <C-R>=expand("<cfile>")<CR><CR>
- nmap <C-\>i :cs find i <C-R>=expand("<cfile>")<CR><CR>
- nmap <C-\>d :cs find d <C-R>=expand("<cword>")<CR><CR>
- "QuickFix
- nmap <F6> :cw<cr>
- nmap <F7> :cn<cr>
- nmap <F8> :cp<cr>
- syntax enable
- syntax on
- set backspace=indent,eol,start
- "Set mapleader
- let mapleader = ","
- "Fast reloading of the .vimrc
- map <silent> <leader>ss :source ~/.vimrc<cr>
- "Fast editing of .vimrc
- map <silent> <leader>ee :e ~/.vimrc<cr>
- "When .vimrc is edited, reload it
- autocmd! bufwritepost .vimrc source ~/.vimrc
- "TagList
- let Tlist_Ctags_Cmd = '/usr/bin/ctags' "设定linux系统中ctags程序的位置
- let Tlist_Show_One_File = 1 "不同时显示多个文件的tag,只显示当前文件的
- let Tlist_Exit_OnlyWindow = 1 "如果taglist窗口是最后一个窗口,则退出vim
- "let Tlist_Use_Right_Window = 1 "在右侧窗口中显示taglist窗口
- "使用<F11>键就可以打开/关闭taglist窗口
- "map <silent> <F11> :TlistToggle<cr>
- """"""""""""""""""""""""""""""
- " netrw setting
- """"""""""""""""""""""""""""""
- "let g:netrw_winsize = 30
- "nmap <silent> <leader>fe :Sexplore!<cr>
- """"""""""""""""""""""""""""""
- " winManager setting
- """"""""""""""""""""""""""""""
- let g:winManagerWindowLayout = "BufExplorer,FileExplorer|TagList"
- let g:winManagerWidth = 30
- let g:defaultExplorer = 0
- "nmap <C-W><C-F> :FirstExplorerWindow<cr>
- "nmap <C-W><C-B> :BottomExplorerWindow<cr>
- nmap <F3> :FirstExplorerWindow<cr>
- nmap <F4> :BottomExplorerWindow<cr>
- "nmap <silent> <leader>wm :WMToggle<cr>
- nmap wm :WMToggle<cr>
- """"""""""""""""""""""""""""""
- " BufExplorer
- """"""""""""""""""""""""""""""
- let g:bufExplorerDefaultHelp=0 " Do not show default help.
- let g:bufExplorerShowRelativePath=1 " Show relative paths.
- let g:bufExplorerSortBy='mru' " Sort by most recently used.
- let g:bufExplorerSplitRight=0 " Split left.
- let g:bufExplorerSplitVertical=1 " Split vertically.
- let g:bufExplorerSplitVertSize = 30 " Split width
- let g:bufExplorerUseCurrentWindow=1 " Open in new window.
- autocmd BufWinEnter \[Buf\ List\] setl nonumber
- """"""""""""""""""""""""""""""
- " lookupfile setting
- " """"""""""""""""""""""""""""""
- let g:LookupFile_MinPatLength = 2
- let g:LookupFile_PreserveLastPattern = 0
- let g:LookupFile_PreservePatternHistory = 0
- let g:LookupFile_AlwaysAcceptFirst = 1
- let g:LookupFile_AllowNewFiles = 0
- let g:LookupFile_UsingSpecializedTags = 1
- let g:LookupFile_Bufs_LikeBufCmd = 0
- let g:LookupFile_ignorecase = 1
- let g:LookupFile_smartcase = 1
- if filereadable("./filenametags")
- let g:LookupFile_TagExpr = '"./filenametags"'
- endif
- nmap <silent> <leader>lk :LUTags<cr>
- nmap <silent> <leader>ll :LUBufs<cr>
- nmap <silent> <leader>lw :LUWalk<cr>
- "
- "
- " lookup file with ignore case
- function! LookupFile_IgnoreCaseFunc(pattern)
- let _tags = &tags
- try
- let &tags = eval(g:LookupFile_TagExpr)
- let newpattern = '\c' . a:pattern
- let tags = taglist(newpattern)
- catch
- echohl ErrorMsg | echo "Exception: " . v:exception | echohl NONE
- return ""
- finally
- let &tags = _tags
- endtry
- " Show the matches for what is typed so far.
- let files = map(tags, 'v:val["filename"]')
- return files
- endfunction
- let g:LookupFile_LookupFunc = 'LookupFile_IgnoreCaseFunc'
- "autocomplete
- filetype plugin indent on
- set completeopt=longest,menu
- "set nocp
- "filetype plugin on
- " mapping
- inoremap <expr> <CR> pumvisible()?"\<C-Y>":"\<CR>"
- inoremap <expr> <C-J> pumvisible()?"\<PageDown>\<C-N>\<C-P>":"\<C-X><C-O>"
- inoremap <expr> <C-K> pumvisible()?"\<PageUp>\<C-P>\<C-N>":"\<C-K>"
- inoremap <expr> <C-U> pumvisible()?"\<C-E>":"\<C-U>"
- autocmd FileType c,cpp set shiftwidth=4 | set expandtab
- let g:SuperTabRetainCompletionType = 2
- "let g:SuperTabDefaultCompletionType = "<C-X><C-O>"
- " OmniCppComplete
- let OmniCpp_NamespaceSearch = 1
- let OmniCpp_GlobalScopeSearch = 1
- let OmniCpp_ShowAccess = 1
- let OmniCpp_ShowPrototypeInAbbr = 1 " show function parameters
- let 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 window
- au CursorMovedI,InsertLeave * if pumvisible() == 0|silent! pclose|endif
- set completeopt=menuone,menu,longest,preview
- map <C-F12> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<CR>
- ".h <---> .cpp
- nnoremap <silent> <F12> :A<CR>
- if &term =~ "xterm"
- if has("terminfo")
- set t_Co=8
- set t_Sf=<Esc>[3%p1%dm
- set t_Sb=<Esc>[4%p1%dm
- else
- set t_Co=8
- set t_Sf=<Esc>[3%dm
- set t_Sb=<Esc>[4%dm
- endif
- endif
- " execute project related configuration in current directory
- if filereadable("workspace.vim")
- source workspace.vim
- endif
复制代码 |
|