[root@m01 ~]# cat ~/.vimrc
set ts=4
set expandtab
set ignorecase
autocmd BufNewFile *.sh exec ":call SetTitle()"
func SetTitle()
if expand("%:e") == 'sh'
call setline(1,"#!/bin/bash")
call setline(2,"#")
call setline(3,"#****************************************************************************************")
call setline(4,"#Author: linfan")
call setline(5,"#Emile: 16601500035@163.com")
call setline(6,"#FileName: ".expand("%"))
call setline(7,"#Date: ".strftime("%Y-%m-%d"))
call setline(8,"#Description: ")
call setline(9,"#****************************************************************************************")
call setline(10,"")
endif
endfunc
autocmd BufNewFile * normal G
08-20
167
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
05-18
974
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
01-14
1万+
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
11-07
1476
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
05-04
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交