I want to tune vim to be convenient for editing python code. The vim has already turned on filetype and related plugins, so I create a file "python.vim" in "~/.vim/ftplugin", and add the following lines in it:
" tune indentation
0read ~/.vim/template/python.template | normal G
The first block is fine, but I met a trouble with the second one. The purpose I write it is to automatically use a specific template for a new python code file, but the result is that it is executed everytime a python code file is opened, no matter it is new or old. That is not what I want.
I know I can set it in "~/.vimrc" by
autocmd BufNewFile *.py 0read ~/.vim/template/python.template | normal G
But it is a little loose, and it doesn't use vim specific filetype. So how does vim know a python code file is new or old in python.vim above.
Thanks for help!