zoukankan      html  css  js  c++  java
  • shell--打开新的.sh文件,直接添加title

     11 autocmd BufNewFile *.sh exec ":call MyTitle()"
     12 func MyTitle()
     13     if expand("%:e") == 'sh'
     14     call setline(1,"#!/bin/bash")
     15     call setline(2,"#=================================================================")
     16     call setline(3,":<<readme")
     17     call setline(4,"Author:                liuye")
     18     call setline(5,"QQ:                    931478729 ")
     19     call setline(6,"Date:                  ".strftime("%Y-%m-%d"))
     20     call setline(7,"FileName:              ".expand("%"))
     21     call setline(8,"URL:                   https://home.cnblogs.com/u/axjlxy/")
     22     call setline(9,"Destcription           study shell script")
     23     call setline(10,"Copyright (C)         ".strftime("%Y")." All right reserved")
     24     call setline(11,"readme")
     25     call setline(12,"#=================================================================")
     26     call setline(13,"")
     27     endif
     28 endfunc
     29 autocmd BufNewFile * normal G

    在家目录的vimrc中添加如上代码段source ~/.vimrc即可

    有时候,不小心知道了一些事,才发现自己所在乎的事是那么可笑。
  • 相关阅读:
    P2045 方格取数加强版
    P2774 方格取数问题
    日记——OI历程
    6.30考试
    6.29考试
    数论...
    6.28数论测试
    洛谷P3802 小魔女帕琪
    hosts
    博客设置
  • 原文地址:https://www.cnblogs.com/axjlxy/p/10926867.html
Copyright © 2011-2022 走看看