set ignorecase
set autoindent
autocmd BufNewFile *.sh exec ":call SetTitle()"
func SetTitle()
if expand("%:e") == 'sh'
call setline(2,"#[----------]")
call setline(1,"#!/bin/bash")
call setline(3,"#--------------------------------------------------------------")
call setline(4,"#Author: jackie")
call setline(5,"#QQ: [email protected]")
call setline(6,"#Date: ".strftime("%F_%T"))
call setline(7,"#FileName: ".expand("%"))
call setline(8,"#URL: https://blog.csdn.net/weixin_50504879")
call setline(9,"#Description: The test script")
call setline(10,"#Copyright (C): ".strftime("%F")." All rights reserved")
call setline(11,"#--------------------------------------------------------------")
call setline(12,"")
endif
endfunc
autocmd BufNewFile * normal G
标签:10,set,vimrc,SetTitle,BufNewFile,call,setline
From: https://www.cnblogs.com/zikang/p/17103944.html