$ vi ~/.vim/sh_header.temp
Custom Header Template for Scripts
#!/bin/bash
###################################################################
#Script Name :
#Description :
#Args :
#Author :usename
#Email :[email protected]
###################################################################
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.