if has("cscope")
set csto=0
set cst
set nocsverb
" add any database in current directory
if filereadable("cscope.out")
cs add cscope.out
" else add database pointed to by environment
elseif $CSCOPE_DB != ""
cs add $CSCOPE_DB
endif
set csverb
endif
map <C-F12> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<CR>
map <F5> :TlistToggle<CR>
let Tlist_Show_One_File=1
let Tlist_Exit_OnlyWindow=1
set ignorecase
set hlsearch
set ts=4
set expandtab
autocmd BufNewFile *.[ch],*.hpp,*.cpp exec ":call SetTitle()"
func SetComment()
call setline(1,"/**************************************************************")
call append(line("."), " * Copyright (C) ".strftime("%Y")." All rights reserved.")
call append(line(".")+1, " * ")
call append(line(".")+2, " * FileName :".expand("%:t"))
call append(line(".")+3, " * Author:Hongtao Xu")
call append(line(".")+4, " * Create Date :".strftime("%Y-%m-%d"))
call append(line(".")+5, " * Decript:")
call append(line(".")+6, " *")
call append(line(".")+7, "**************************************************************/")
endfunc
func SetTitle()
call SetComment()
if expand("%:e") == 'hpp'
call append(line(".")+8, "#ifndef _".toupper(expand("%:t:r"))."_H_")
call append(line(".")+9, "#define _".toupper(expand("%:t:r"))."_H_")
call append(line(".")+10, "#ifdef __cplusplus")
call append(line(".")+11, "extern \"C\"")
call append(line(".")+12, "{")
call append(line(".")+13, "#endif")
call append(line(".")+14, "")
:set nonumber 1,1 顶端
我到vimrc文件
最新推荐文章于 2023-02-19 18:34:36 发布