在linux终端下敲入 vi ~/.vimrc 即可进入vimrc配置文件
以下内容复制粘贴在vimrc配置文件最后一行即可使用
可以帮你节省时间
autocmd BufNewFile *.py,*.cpp,*.[ch],*.sh,*.java exec ":call SetTitle()"
func SetTitle()
if &filetype == 'c'
call append(0, "")
call append(7, "#include
call append(8, "")
call append(9, "int main(int argc,char *argv[])")
call append(10, "{")
call append(12, " return 0;")
call append(13, "}")
endif
if expand("%:e") == 'h'
call append(0, "#ifndef _".toupper(expand("%:r"))."_H")
call append(1, "#define _".toupper(expand("%:r"))."_H")
call append(3, "")
call append(4, "#endif")
endif
if &filetype == 'sh'
call setline(1,"#****************************************************************************************")
call append(line("."), "# File Name: ".expand("%"))
call append(line(".")+1, "# Author: hxy")
call append(line(".")+2, "# mail: ")
call append(line(".")+3, "# Created Time:".strftime("%c"))
call append(line(".")+4, "#************************************************************************************")
call append(line(".")+5, "#!/bin/bash")
call append(line(".")+6, "")
call append(line(".")+7, "")
endif
endfunc



