vi 實在是個非常棒的編輯器... 功能太強大了...
而且非常方便又好用... 沒有它實在是綁手綁腳的... 唉...
我的 .vimrc 如下
syntax on
set expandtab
set shiftwidth=4
set softtabstop=4
set tabstop=4
set number
set cindent
set autoindent
這些在平常寫程式時很好用唷.. 🙂
# 自動判斷 big5 或 utf-8 會自動換編碼(Linux 設以下設定)
兩種方法:
1.
" 檔案存檔會存成utf-8編碼
"set fileencoding=utf-8
"
" 以下四個設下去. vim 編出來都是 utf-8 編碼的.
set fileencoding=utf-8
set fileencodings=big5,utf-8
set termencoding=big5
set enc=utf-8
" iconv -f big5 -t utf8 file.big5
2.
if has("multi_byte")
let $LANG="zh_TW.UTF-8"
set encoding=utf-8
setglobal fileencoding=big5
set fileencoding=big5
set bomb
set termencoding=big5
set fileencodings=utf-8,big5,euc-jp,gbk,euc-kr,utf-bom,iso8859-1
else
echoerr "Sorry, this version of (g)vim was not compiled with multi_byte"
endif
其它還有非常多功能.. 就下面再說囉.. 🙂
閱讀全文〈vi 設定〉