实现shell脚本模板,自动生成开头注释信息
建议在用户家目录创建.vimrc文件:
文件格式如下:
文件格式如下:
set ignorecase set autoindent set paste autocmd BufNewFile *.sh exec ":.call SetTitle()" func SetTitle() if expand("%:e") == ‘sh‘ call setline(1,"#!/bin/bash") call setline(2,"#***********************************************") call setline(3,"#Author: Tom") call setline(4,"#Mail: ") call setline(5,"#Version: 1.0") call setline(6,"#Date: ".strftime("%Y-%m-%d")) call setline(7,"#FileName: ".expand("%")) call setline(8,"#Description: The test script") call setline(9,"#***********************************************") call setline(10,"") endif endfunc autocmd BufNewFile * normal G
相关推荐
huha 2020-10-16
laisean 2020-11-11
大牛牛 2020-10-30
firefaith 2020-10-30
liguojia 2020-10-20
wangzhaotongalex 2020-10-20
以梦为马不负韶华 2020-10-20
JohnYork 2020-10-16
Julyth 2020-10-16
applecarelte 2020-10-16
laisean 2020-09-27
flycappuccino 2020-09-27
liguojia 2020-09-27
wangzhaotongalex 2020-09-22
流年浅滩 2020-10-23
liujianhua 2020-10-22
woaimeinuo 2020-10-21
tufeiax 2020-09-03
laisean 2020-09-01