杰猛人
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
这根本就不全,你在网上搜下vim的配置 , 一大堆别人的配置,有的有详细的注释。
function SetTitle( )
应该是func SetTitle( )
重启 或者 source 一下
Shell典型应用之主控脚本实现
37224 学习 · 42 问题
相似问题