您的位置:首页 > 其它

vim 新建文件添加模板

2018-03-04 00:00 387 查看
$ vi ~/.vim/sh_header.temp

Custom Header Template for Scripts
#!/bin/bash
###################################################################
#Script Name :
#Description :
#Args :
#Author :usename
#Email :xcccc@gmail.com
###################################################################

Configure autocmd in Vimrc File

vi ~/.vimrc #添加以下内容

au bufnewfile *.sh 0r /home/aaronkilik/.vim/sh_header.temp

解释:

.au – means autocmd
.bufnewfile – event for opening a file that doesn’t exist for editing.
.*.sh – consider all files with .sh extension.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  vim