zoukankan      html  css  js  c++  java
  • 写脚本自动生成行首信息

    [16:20:30 root@centos8 ~]#vim .vimrc

    set nu
    set cursorline
    set hlsearch
    autocmd BufNeWFile *.sh exec ":call SetTitle()"
    func SetTitle()
    if expand("%:e") == 'sh'
    call setline(1,"#!/bin/bash")
    call setline(2,"#")
    call setline(3,"#***************************************************************************")
    call setline(4,"#Author: zhouchang")
    call setline(5,"#QQ: 1520509800")
    call setline(6,"#Date: ".strftime("%Y-%m-%d"))
    call setline(7,"#Filename: ".expand("%"))
    call setline(8,"#URL: https://www.cnblogs.com/shenyuanhaojie/")
    call setline(9,"#Description: The test script")
    call setline(10,"#Copyright (C): ".strftime("%Y")." All rights reserved")
    call setline(11,"#**************************************************************************")
    call setline(12,"")
    endif
    endfunc
    autocmd BufNeWFile * normal G

  • 相关阅读:
    iOS开发-Sqlite
    iOS开发-HTTP协议
    iOS开发
    iOS 开发小记 (八)
    iOS
    iOS开发-基础框架
    Java门面模式
    Linux常用命令
    canal使用小结
    MySQL隔离级别的测试
  • 原文地址:https://www.cnblogs.com/shenyuanhaojie/p/13964566.html
Copyright © 2011-2022 走看看