• 编写生成脚本基本格式的脚本,包括作者,联系方式,版本,时间,描述等


    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:    lanfeng")
        call setline(5,"#QQ:        447320311")
        call setline(6,"#Date:        ".strftime("%Y-%m-%d"))
        call setline(7,"#FileName:    ".expand("%"))
        call setline(8,"#Version:    1.1")
        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

    从xshell将代码复制过来时,文本的对齐有多改变。

  • 相关阅读:
    Python的object和type理解及主要对象层次结构
    【译】Matplotlib:plotting
    random
    【译】itertools
    VBA笔记
    Python Function
    Outlook API
    VB参考
    类方法:绑定或无绑定
    【摘录】数据库连接参数
  • 原文地址:https://www.cnblogs.com/qianyuezhan/p/13290596.html
Copyright © 2020-2023  润新知