Vim 配置

来源:互联网 发布:手机怎么找到淘宝旺旺 编辑:程序博客网 时间:2024/06/11 15:48

记录下我的.vimrc

set nuset hlsset incsearchsyntax enablesyntax onlet mapleader = ","       "Set mapleadermap <C-F7> ,bemap <C-F6> ,mbt",be/,bt  Open Buffer explorer",mbt Toggle mini Buf explorermap <C-F12> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<CR> "map <C-A> :TlistToggle<CR>let Tlist_Show_One_File=1  let Tlist_Exit_OnlyWindow=1  let Tlist_Use_Right_Window=1"let g:winManagerWindowLayout='BufExplorer,FileExplorer|TagList'let g:winManagerWindowLayout='FileExplorer'nmap <C-F9> :WMToggle<cr>nmap <C-F10> :TlistToggle<cr>map <C-F11> :Rgrep<CR>let g:miniBufExplMapWindowNavVim = 100"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 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 csverbendifset cscopequickfix=s-,c-,d-,i-,t-,e-nmap <F8>s :cs find s <C-R>=expand("<cword>")<CR><CR>nmap <F8>g :cs find g <C-R>=expand("<cword>")<CR><CR>nmap <F8>c :cs find c <C-R>=expand("<cword>")<CR><CR>nmap <F8>t :cs find t <C-R>=expand("<cword>")<CR><CR>nmap <F8>e :cs find e <C-R>=expand("<cword>")<CR><CR>nmap <F8>f :cs find f <C-R>=expand("<cfile>")<CR><CR>nmap <F8>i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR>nmap <F8>d :cs find d <C-R>=expand("<cword>")<CR><CR>map <C-F8> :!cs_load.sh <CR> :cs add cscope.out <CR>"-----------------------------------------------------------------------------" lookupfile.vim 插件设置"-----------------------------------------------------------------------------let g:LookupFile_MinPatLength = 2               "最少输入2个字符才开始查找let g:LookupFile_PreserveLastPattern = 0        "不保存上次查找的字符串let g:LookupFile_PreservePatternHistory = 1     "保存查找历史let g:LookupFile_AlwaysAcceptFirst = 1          "回车打开第一个匹配项目let g:LookupFile_AllowNewFiles = 0              "不允许创建不存在的文件let g:LookupFile_SortMethod = ""                "关闭对搜索结果的字母排序if filereadable("./filenametags")                "设置tag文件的名字let g:LookupFile_TagExpr ='"./filenametags"'endifmap <C-F5> :!generate_lookupinfo.sh <CR>  :let g:LookupFile_TagExpr ='"./filenametags"' <CR>"Define by louyong "Reversal line number setting:function Rev_LineNum():  if &number == 1:    set nonumber:  else:    set number:  endif:endfunctionmap <silent><C-N> :call Rev_LineNum()<CR>"Reversal mouse setting:function Rev_Mouse():  if &mouse == "":    set mouse=a:  else:    set mouse=:  endif:endfunctionmap <silent><C-M> :call Rev_Mouse()<CR>"Only settingmap <silent>,o :only<CR>"Setting cursor status:function Rev_CursorLine():  if &cursorline == 0:    set cursorline:  else:    set nocursorline :  endif:endfunction:function Rev_CursorColumn():  if &cursorcolumn == 0:    set cursorcolumn :  else:    set nocursorcolumn:  endif:endfunctionmap <silent>,l :call Rev_CursorLine()<CR>map <silent>,ll :call Rev_CursorColumn()<CR>map <silent>,lll :call Rev_CursorColumn()<CR> :call Rev_CursorLine()<CR>"android manifest jump:function Search_OpenTypeFiles(suffix):  let filename=expand("<cword>"):  let java_filename=filename . "." . a:suffix:  let $REALPATH=findfile(java_filename, "**") :  if empty($REALPATH):    echo "Can not find " . java_filename :  else:    find $REALPATH:    call search(filename):  endif:endfunctionmap <silent>,fj :call Search_OpenTypeFiles("java")<CR>map <silent>,fc :call Search_OpenTypeFiles("c")<CR>map <silent>,fC :call Search_OpenTypeFiles("cpp")<CR>map <silent>,fh :call Search_OpenTypeFiles("h")<CR>"add for session write/read/cleanmap <silent>,ms :mksession vim.session<CR>:wviminfo vim.info<CR>map <silent>,rs :source vim.session<CR>:rviminfo vim.info<CR>map <silent>,cs :!rm vim.session vim.info tags cscope.* filenametags<CR>


脚本:

 cat  /usr/bin/generate_lookupinfo.sh#!/bin/sh # generate tag file for lookupfile pluginecho -e "!_TAG_FILE_SORTED\t2\t/2=foldcase/" > filenametagsfind . -not -regex '.*\.\(png\|gif\)' -type f -printf "%f\t%p\t1\n" | sort -f >> filenametags

cat  /usr/bin/cs_load.sh #!/bin/sh  #!/bin/sh      #find $(pwd) -type f > cscope.files   #cscope -bkq -i cscope.files   #ctags -R find . -name "*.h" -o -name "*.c" -o -name "*.cpp" -o -name "*.java">cscope.files  cscope -bkq -i cscope.files  ctags -R 


我的插件:

grep.vimminibufexpl.vimSuperTab.vimtaglist.vimvisualmark.vimwinfileexplorer.vimwinmanager.vimwintagexplorer.vimlookupfile.vimgenutils.vim


0 0