自动添加shell脚本头部信息
autocmd BufNewFile *.sh exec ":call AddTitleForShell()" function AddTitleForShell() call append(0,"#!/bin/bash") call append(1,"# **********************************************************") call append(2,"# * Author : quanzhiqiang") call append(3,"# * Email : 13145710069@163.com") call append(4,"# * Create time : ".strftime("%Y-%m-%d %H:%M")) call append(5,"# * Filename : ".expand("%:t")) call append(6,"# * Description : ") call append(7,"# **********************************************************") endfunction