作者qwertmn (抽筋)
看板Editor
標題Re: [vim ] 自動為.py加上python path跟設定utf8?
時間Sun Jul 8 17:50:42 2012
function PyHeader()
if getfsize(@%) <= 0
execute "norm i#!/usr/bin/env python^M# -*- coding: utf-8 -*-"
endif
endfunction
au BufRead,BufNewFile *.py call PyHeader()
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 203.73.236.63
1F:推 kusoayan:厲害 07/08 17:51
2F:推 martinku:猛! 07/10 00:32
3F:→ stimim:au BufNewFile *.py 0r ~/.vim/templates/py.tpl 07/11 12:47
4F:→ stimim:然後在 .vim/tmplates/py.tpl 裡打預設的內容 07/11 12:48
5F:→ qwertmn:推3樓~ 不過我習慣下touch 產目錄結構~ 07/11 19:11
6F:推 albb0920:這個讚!! 08/06 00:57