|  |      1kumu      2013-09-10 17:11:52 +08:00  1 function HeaderPython()                                                                                call setline(1, "#!/usr/bin/env python") call append(1, "# -*- coding: utf-8 -*-") normal G normal o normal o endf autocmd bufnewfile *.py call HeaderPython() 加入以上代码即可 | 
|      3xiaokai      2013-09-10 17:30:51 +08:00  1 | 
|      4xiaokai      2013-09-10 17:32:37 +08:00  1 | 
|      5mengzhuo      2013-09-10 17:36:57 +08:00 用上snippets吧 https://github.com/honza/vim-snippets | 
|  |      6eth2net      2013-09-10 17:59:41 +08:00 | 
|  |      7jpuyy      2013-09-10 20:20:25 +08:00 | 
|  |      8wklken      2013-09-10 22:19:38 +08:00 装个ultisnips  https://github.com/wklken/k-vim#sirverultisnips | 
|  |      9syv2      2013-09-10 22:56:48 +08:00 在.vimrc里添加一行 autocmd BufNewFile *.py 0r /path_to_template_file | 
|  |      10GreenHand      2013-09-11 00:26:56 +08:00 autocmd BufNewFile *.py 0r ~/.python_template.py |