文件格式如下:
set ignorecase
set autoindent
set paste
autocmd BufNewFile *.sh exec ":.call SetTitle()"
func SetTitle()
if expand("%:e") == ‘sh‘
call setline(1,"#!/bin/bash")
call setline(2,"#***********************************************")
call setline(3,"#Author: Tom")
call setline(4,"#Mail: 123456789@qq.com")
call setline(5,"#Version: 1.0")
call setline(6,"#Date: ".strftime("%Y-%m-%d"))
call setline(7,"#FileName: ".expand("%"))
call setline(8,"#Description: The test script")
call setline(9,"#***********************************************")
call setline(10,"")
endif
endfunc
autocmd BufNewFile * normal G