我的vimrc文件的配置(fedora、debian、ubuntu都可以用)
2013-04-05 22:39
127 查看
map <F12> :call Do_CsTag()<CR>
nmap <C-@>s :cs find s <C-R>=expand("<cword>")<CR><CR>:copen<CR>
nmap <C-@>g :cs find g <C-R>=expand("<cword>")<CR><CR>
nmap <C-@>c :cs find c <C-R>=expand("<cword>")<CR><CR>:copen<CR>
nmap <C-@>t :cs find t <C-R>=expand("<cword>")<CR><CR>:copen<CR>
nmap <C-@>e :cs find e <C-R>=expand("<cword>")<CR><CR>:copen<CR>
nmap <C-@>f :cs find f <C-R>=expand("<cfile>")<CR><CR>:copen<CR>
nmap <C-@>i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR>:copen<CR>
nmap <C-@>d :cs find d <C-R>=expand("<cword>")<CR><CR>:copen<CR>
function Do_CsTag()
let dir = getcwd()
if filereadable("tags")
if(g:iswindows==1)
let tagsdeleted=delete(dir."\\"."tags")
else
let tagsdeleted=delete("./"."tags")
endif
if(tagsdeleted!=0)
echohl WarningMsg | echo "Fail to do tags! I cannot delete the tags" | echohl None
return
endif
endif
if has("cscope")
execute "cs kill -1″
endif
if filereadable("cscope.files")
if(g:iswindows==1)
let csfilesdeleted=delete(dir."\\"."cscope.files")
else
let csfilesdeleted=delete("./"."cscope.files")
endif
if(csfilesdeleted!=0)
echohl WarningMsg | echo "Fail to do I cannot delete the cscope.files" | echohl None
return
endif
endif
if filereadable("cscope.out")
if(g:iswindows==1)
let csoutdeleted=delete(dir."\\"."cscope.out")
else
let csoutdeleted=delete("./"."cscope.out")
endif
if(csoutdeleted!=0)
echohl WarningMsg | echo "Fail to do I cannot delete the cscope.out" | echohl None
return
endif
endif
if(executable('ctags'))
" execute "!ctags -R –c-types=+p –fields=+S *"
execute "!ctags -R –c++-kinds=+p –fields=+iaS –extra=+q ."
endif
if(executable('cscope') && has("cscope") )
if(g:iswindows!=1)
execute "!find . -name '*.h' -o -name '*.c' -o -name '*.cpp' -o -name '*.java' -o -name '*.cs' > cscope.files"
else
execute "!dir /s/b *.c,*.cpp,*.h,*.java,*.cs >> cscope.files"
endif
execute "!cscope -b"
execute "normal :"
if filereadable("cscope.out")
execute "cs add cscope.out"
endif
endif
endfunction
"进行Tlist的设置
"TlistUpdate可以更新tags
map <F3> : Tlist<CR> "按下F3就可以呼出了
let Tlist_Ctags_Cmd='ctags' "因为我们放在环境变量里,所以可以直接执行
let Tlist_Use_Right_Window=1 "让窗口显示在右边,0的话就是显示在左边
let Tlist_Show_One_File=0 "让taglist可以同时展示多个文件的函数列表,如果想只有1个,设置为1
let Tlist_File_Fold_Auto_Close=1 "非当前文件,函数列表折叠隐藏
let Tlist_Exit_OnlyWindow=1 "当taglist是最后一个分割窗口时,自动推出vim
"是否一直处理tags.1:处理;0:不处理
"let Tlist_Process_File_Always=0
set encoding=utf-8 fileencodings=ucs-bom,utf-8,cp936
set textwidth=78
set wrap
set brk=78
set cindent
nmap <C-@>s :cs find s <C-R>=expand("<cword>")<CR><CR>:copen<CR>
nmap <C-@>g :cs find g <C-R>=expand("<cword>")<CR><CR>
nmap <C-@>c :cs find c <C-R>=expand("<cword>")<CR><CR>:copen<CR>
nmap <C-@>t :cs find t <C-R>=expand("<cword>")<CR><CR>:copen<CR>
nmap <C-@>e :cs find e <C-R>=expand("<cword>")<CR><CR>:copen<CR>
nmap <C-@>f :cs find f <C-R>=expand("<cfile>")<CR><CR>:copen<CR>
nmap <C-@>i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR>:copen<CR>
nmap <C-@>d :cs find d <C-R>=expand("<cword>")<CR><CR>:copen<CR>
function Do_CsTag()
let dir = getcwd()
if filereadable("tags")
if(g:iswindows==1)
let tagsdeleted=delete(dir."\\"."tags")
else
let tagsdeleted=delete("./"."tags")
endif
if(tagsdeleted!=0)
echohl WarningMsg | echo "Fail to do tags! I cannot delete the tags" | echohl None
return
endif
endif
if has("cscope")
execute "cs kill -1″
endif
if filereadable("cscope.files")
if(g:iswindows==1)
let csfilesdeleted=delete(dir."\\"."cscope.files")
else
let csfilesdeleted=delete("./"."cscope.files")
endif
if(csfilesdeleted!=0)
echohl WarningMsg | echo "Fail to do I cannot delete the cscope.files" | echohl None
return
endif
endif
if filereadable("cscope.out")
if(g:iswindows==1)
let csoutdeleted=delete(dir."\\"."cscope.out")
else
let csoutdeleted=delete("./"."cscope.out")
endif
if(csoutdeleted!=0)
echohl WarningMsg | echo "Fail to do I cannot delete the cscope.out" | echohl None
return
endif
endif
if(executable('ctags'))
" execute "!ctags -R –c-types=+p –fields=+S *"
execute "!ctags -R –c++-kinds=+p –fields=+iaS –extra=+q ."
endif
if(executable('cscope') && has("cscope") )
if(g:iswindows!=1)
execute "!find . -name '*.h' -o -name '*.c' -o -name '*.cpp' -o -name '*.java' -o -name '*.cs' > cscope.files"
else
execute "!dir /s/b *.c,*.cpp,*.h,*.java,*.cs >> cscope.files"
endif
execute "!cscope -b"
execute "normal :"
if filereadable("cscope.out")
execute "cs add cscope.out"
endif
endif
endfunction
"进行Tlist的设置
"TlistUpdate可以更新tags
map <F3> : Tlist<CR> "按下F3就可以呼出了
let Tlist_Ctags_Cmd='ctags' "因为我们放在环境变量里,所以可以直接执行
let Tlist_Use_Right_Window=1 "让窗口显示在右边,0的话就是显示在左边
let Tlist_Show_One_File=0 "让taglist可以同时展示多个文件的函数列表,如果想只有1个,设置为1
let Tlist_File_Fold_Auto_Close=1 "非当前文件,函数列表折叠隐藏
let Tlist_Exit_OnlyWindow=1 "当taglist是最后一个分割窗口时,自动推出vim
"是否一直处理tags.1:处理;0:不处理
"let Tlist_Process_File_Always=0
set encoding=utf-8 fileencodings=ucs-bom,utf-8,cp936
set textwidth=78
set wrap
set brk=78
set cindent
相关文章推荐
- fedora与ubuntu的网络配置文件
- Linux系统(Ubuntu/Debian/RedHat/CentOS)超级简单的samba配置文件smb.conf
- vim 配置文件 .vimrc 脚本(Linux,Mac OS都可以用)
- 我的Ubuntu vim配置文件vimrc(无编程插件版)
- Ubuntu下改写vim配置文件vimrc来实现显示行号,语法高亮,自动缩进功能
- vim 配置文件 .vimrc 脚本(Linux,Mac OS都可以用)
- ubuntu下vim的配置文件.vimrc的创建(转)
- ubuntu下vim的配置文件.vimrc的创建
- Ubuntu vimrc配置文件 vim 设置行号,缩进距等
- ubuntu下gvim配置文件.vimrc
- ubuntu下gvim配置文件.vimrc
- Ubuntu下改写vim配置文件vimrc来实现显示行号,语法高亮,自动缩进功能
- Ubuntu下改写vim配置文件 vimrc来实现显示行号,语法高亮,自动缩进功能
- Ubuntu、Debian、OpenSUSE、Fedora、Redhat和CentOS安装pgplot的步骤
- Ubuntu 共享文件 samba服务器配置
- ubuntu codeblocks通过配置文件修改主题
- 关于Ubuntu配置文件apache2 httpd.conf 位置
- Ubuntu配置samba--与windows共享文件
- Ubuntu配置Samba共享文件