vi script problem on autocmd

Posted by schemacs on Stack Overflow See other posts from Stack Overflow or by schemacs
Published on 2010-04-25T02:54:05Z Indexed on 2010/04/25 3:03 UTC
Read the original article Hit count: 262

Filed under:

I want to create a template for all my python scripts using this

autocmd bufnewfile *.py so ~/.vim/templates/python_skeleton.txt

the content of python_sekleton.txt is as simple as this:

#!/usr/bin/python
# -*- coding: utf-8 -*-

print 'Hello World'

but vi give error message when i start to edit a new python script:

line    2:
E488: Trailing characters: # -*- coding: utf-8 -*-
line    4:
E488: Trailing characters: print 'Hello World'

it seems '#' is not escaped,and anyone can work it out?thanks i advance

© Stack Overflow or respective owner

Related posts about vim