I want to add some comment lines when to edit python file:
vim .vimrc
autocmd BufNewFile *.py exec ":call SetTitle_py()"
func SetTitle_py()
call append(line("."), "#!/usr/bin/env python3" )
call append(line(".")+1, "# -*- coding:utf-8 -*- ")
endfunc
The title is set at the second line when to edit a py file with vim test.py
,instead of the first line?
append()