码迷,mamicode.com
首页 > 系统相关 > 详细

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

时间:2019-10-05 20:12:03      阅读:156      评论:0      收藏:0      [点我收藏+]

标签:shu   set   mamicode   font   span   img   time   author   and   

 

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

技术图片

 

 

具体/etc/vimrc配置为:

技术图片

 

 if expand("%:e") == ‘sh‘

 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

 

 

 

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

标签:shu   set   mamicode   font   span   img   time   author   and   

原文地址:https://www.cnblogs.com/hushuning/p/11625459.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!