vim 创建py 文件的能不能第一行自动添加这一句:
#-*- encoding:utf-8 -*-
#-*- encoding:utf-8 -*-
|
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() 加入以上代码即可 |
|
3
|
|
4
|
|
mengzhuoSep 10, 2013
5
用上snippets吧
https://github.com/honza/vim-snippets |
|
eth2netSep 10, 2013
6
|
|
wklkenSep 10, 2013
8
装个ultisnips https://github.com/wklken/k-vim#sirverultisnips
|
|
syv2Sep 10, 2013
9
在.vimrc里添加一行
autocmd BufNewFile *.py 0r /path_to_template_file |
|
GreenHandSep 11, 2013
10
autocmd BufNewFile *.py 0r ~/.python_template.py
|