標籤:
- 1. 中文亂碼問題。
這個問題由來已久,每當我查看 mount到linux下的windows 中文目錄的時候,都是一堆亂碼, putty 也拒絕我輸入中文, 一句話,這玩意,對中文過敏。
解決方式:
1.1修改linux的環境變數。
[[email protected] arm]#vi /etc/sysconfig/i18n |
修改LANG=zh_CN.GBK改為LANG=zh_CN.UTF-8
[[email protected] arm]#source /etc/sysconfig/i18n |
PS:這裡我們採用UTF-8的編碼方式。
1.2修改putty Window>Translation>Received data assumed to be in which character set
選擇 UTF-8
1.3 不要忘記儲存。
儲存到sessions裡。 下次使用就不會變化了。
OK。 簡單三步,解決中文問題:
[[email protected] ztl]# 不正確的選項: ambiwidth=不正確的選項: ambiwidth=double bash: 不正確的選項:: command not found [[email protected] ztl]# 不正確的選項: ambiwidth=double bash: 不正確的選項:: command not found [[email protected] ztl]# vi /root/.vimrc 處理 /root/.vimrc 時發生錯誤: 行 88: 不正確的選項: ambiwidth=double [[email protected] ztl]# [[email protected] ztl]# vi /root/.vimrc |
看,能正確顯示中文。
能正確輸入中文,並能正確顯示中文目錄。
- 2. putty的字型設定。
2.1 在網上搜尋了大半天,找到一個好用的字型: 微軟雅黑字型:
http://img.namipan.com/downfile/7c74a6406da9968cc126d6d33b4e4d11536ef7fbfd177a00/Consolas%e5%ad%97%e4%bd%93%e9%9b%85%e9%bb%91%e6%b7%b7%e5%90%88%e7%89%88YaHei.Consolas.1.11b.rar
不過上面串連是 納米機器人的下載串連。你google一下“Consolas雅黑混合版“很多的。
下載之後拷貝到 c:\WINDOWS\Fonts下面。
2.2選擇putty的字型:
Window>Font settings>Change
選擇Consolas即可
- 3. Vim 配置:
Vim配置,我直接從網上考了一段下來。
http://www.renseng.com/learning/super-vim-configuration-file-be-updated.html
主要參考了這個, 我這裡就不發了。
將上面的檔案拷貝下來, 儲存為/root/.vimrc即可。
- 4. PS1設定
export PS1="\[\e]0;\u \w\a\]\[\033[01;32m\][\u]\[\033[00m\]:\[\033[01;34m\]\W\[\033[00m\]\$" |
- 5. 最終效果:
6
. 參考文獻
PuTTY 中文教程
http://chaifeng.com/blog/2007/06/putty_200611.html#_582484557233528
微軟官方雅黑字型Windows XP版與Consolas雅黑混合版適合編程字型下載
http://www.iplaysoft.com/consolas.html
putty 的美化