在linux设置/etc/vimrc 将vim 中后缀.sh的文件 的前几行进行默认输入

 

输入vim test.sh 新建后缀sh的文件,效果以下:vim

 

 

具体/etc/vimrc配置为:bash

 

 if expand("%:e") == 'sh'spa

 call setline(1,"#!/bin/bash")
 call setline(2,"#")
 call setline(3,"#*************************************")
 call setline(4,"#Author: hushuning")
 call setline(5,"#QQ: 36027102")
 call setline(6,"#Date: ".strftime("%Y-%m-%d"))
 call setline(7,"#Filename: ".expand("%"))
 call setline(8,"#*************************************")
 call setline(9,"")
 endif
 endfunc
blog

相关文章
相关标签/搜索