我到vimrc文件

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          顶端


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值