Re: [vim ] 自動為.py加上python path跟設定utf8?

看板Editor作者 (抽筋)時間12年前 (2012/07/08 17:50), 編輯推噓3(303)
留言6則, 5人參與, 最新討論串2/2 (看更多)
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

07/08 17:51, , 1F
厲害
07/08 17:51, 1F

07/10 00:32, , 2F
猛!
07/10 00:32, 2F

07/11 12:47, , 3F
au BufNewFile *.py 0r ~/.vim/templates/py.tpl
07/11 12:47, 3F

07/11 12:48, , 4F
然後在 .vim/tmplates/py.tpl 裡打預設的內容
07/11 12:48, 4F

07/11 19:11, , 5F
推3樓~ 不過我習慣下touch 產目錄結構~
07/11 19:11, 5F

08/06 00:57, , 6F
這個讚!!
08/06 00:57, 6F
文章代碼(AID): #1F-LVqua (Editor)
文章代碼(AID): #1F-LVqua (Editor)