vim自定义功能
在.vimrc中自定义功能,或者在别的文件中自定义,在.vimrc中source,功能名一定要用大写。
function Test()
...
endfunction
然后在命令行中,:call test()运行
也可以自定义为map <leader>te :call test()<cr>
示例:
function Addtitle()
let username = system('whoami')
call append(1,"Project :")
call append(2,"Filename :".expand("%:t"))
call append(3,"author :".username)
call append(4,"time :".strftime("%Y-%m-%d %H:%M"))
endfunction

浙公网安备 33010602011771号