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