au BufNewFile *.py,*.egg  :call setline(1, "#!/usr/bin/python")

But, how can we insert more than 1 lines?
For example I want:

#!/usr/bin/python
import os
import sys


To build on Yakov's suggestion, you should be able to put whatever lines you want in a file (called, say ~/.python_template) and then use

au BufNewFile *.py,*.egg :0r ~/.python_template

which should then read the contents of that file into the top of the new buffer.

-tim



Reply via email to