
1 kumu 2013-09-10 17:11:52 +08:00 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() 加入以上代码即可 |
3 xiaokai 2013-09-10 17:30:51 +08:00 |
4 xiaokai 2013-09-10 17:32:37 +08:00 |
5 mengzhuo 2013-09-10 17:36:57 +08:00 用上snippets吧 https://github.com/honza/vim-snippets |
6 eth2net 2013-09-10 17:59:41 +08:00 |
7 jpuyy 2013-09-10 20:20:25 +08:00 |
8 wklken 2013-09-10 22:19:38 +08:00 装个ultisnips https://github.com/wklken/k-vim#sirverultisnips |
9 syv2 2013-09-10 22:56:48 +08:00 在.vimrc里添加一行 autocmd BufNewFile *.py 0r /path_to_template_file |
10 GreenHand 2013-09-11 00:26:56 +08:00 autocmd BufNewFile *.py 0r ~/.python_template.py |