参考: VIM自动给脚本加注释

在vimrc里添加下面几行

"添加文件注释
command -nargs=0 Addreadme :call Addreadme()
function Addreadme()
call setline(1,"/**")
call append(1," * @require : none")
call append(2," * @author : someone@bluehua.org")
call append(3," * @date : " . strftime("%Y-%m-%d"))
call append(4," * @description : this is a new file ")
call append(5," */")
endf
:au BufNewFile *.js :Addreadme
Copy Code