按照视屏修改的vimrc文件 为什么没有效果呢?

来源:1-6 VIM编辑器基本设置(下)

杰猛人

2016-10-29 15:31

  9 autocmd BufNewFile *.sh, exec ":call SetTitle()"
 10 let $auathor_name="tomshen"
 11 let $author_email="768047936@qq.com"
 12 
 13 function SetTitle( )
 14 if &filetype == 'sh'
 15 call setline(1,"##############################################################################################    ##############")
 16 call append(line("."), "\# File Name: " .expand("%"))
 17 call append(line(".")+1, "\# Author:" .$author_name)
 18 call append(line(".")+2, "\# Created Time: " .strftime("%c"))
 19 call append(line(".")+4, "\===================================================================================    =================")
 20 call append(line(".")+5, "\#!/bin/bash")
 21 call append(line(".")+6, "")
 22 call setline(1,"\#############################################################################################    ##############")
 23 endif
 24 endfunction


写回答 关注

3回答

  • 殇召
    2016-10-31 14:20:33
    已采纳

    这根本就不全,你在网上搜下vim的配置 , 一大堆别人的配置,有的有详细的注释。

    杰猛人

    非常感谢!

    2016-11-13 20:21:24

    共 1 条回复 >

  • qq_湛蓝色的天空_0
    2017-03-14 19:47:57
    function SetTitle( )

    应该是func SetTitle( )

  • fsasgfdgsd
    2016-10-30 16:54:40

    重启 或者 source 一下

Shell典型应用之主控脚本实现

应用shell实现案例主控脚本,握如何编写主控脚本

37224 学习 · 42 问题

查看课程

相似问题