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

原文地址:https://www.cnblogs.com/air-of-code/p/10272651.html