Home > All, System, VIM > 讓vim同時能讀寫utf8和big5的檔案

讓vim同時能讀寫utf8和big5的檔案

September 20th, 2006

edit ~/.vimrc

set enc=utf-8
set fileencodings=utf-8,cp950,ucs-bom,default,latin1
set termencoding=cp950

重點是termencoding,vim會把utf8格式的檔案讀出來轉成termencoding (for terminal),也就是big5,於是putty / screen可以直接用big5(cp950)接收,不用為了讀寫utf8對putty / screen做一堆設定

感謝老鼠的分享

歷史上的今天

fcamel All, System, VIM

  1. No comments yet.
  1. No trackbacks yet.