自动添加shell首部

【自动添加shell首部】一卷旌收千骑虏,万全身出百重围。这篇文章主要讲述自动添加shell首部相关的知识,希望能为你提供帮助。

vim ~./vimrcautocmd BufNewFile *.sh exec ":call SetTitle()" func SetTitle() if expand("%:e") == \'sh\' call setline(1,"#!/bin/bash") call setline(2,"#********************************************************************") call setline(3,"#Author: Oldxu") call setline(4,"#Date: ".strftime("%Y-%m-%d")) call setline(5,"#FileName: ".expand("%")) call setline(6,"#Description: The test script") call setline(7,"#********************************************************************") call setline(8,"") endif endfunc autocmd BufNewFile * normal G


    推荐阅读