vim autocmd

autocmd BufNewFile *.py exec ":call SetTitle()"

func SetTitle()

  call append(0,"#! /usr/local/python2.6/bin/python")

endfunc

后面不能加分号

autocmd 带有 exec 关键字

autocmd   vimcmd  filetype  exec func

posted @ 2019-01-15 16:27  岁月长河  阅读(468)  评论(0编辑  收藏  举报