Table of Contents
- 1 手把手教你學會 Emacs 主題配置
- 1.1 下載color theme壓縮包
- 1.2 解壓並復制相應文件到.emacs.d/下
- 1.3 在~/.emacs加上如下代碼
- 1.4 在Emacs中查看並選擇
1 手把手教你學會 Emacs 主題配置
其實Emacs 主題非常重要,因為字體的顏色,背景光標等等都是你天天必須面對的,設定一個合適的主題,就像一個舒服的狗窩,讓你不願意離開。而且,更重要的,合適的界面配置能夠保護你的視力,尤其是當你長時間坐在電腦面前碼代碼或者寫文檔的時候,更能體現出來。
下面貼一張我的Emacs主題截圖:
1.1 下載color theme壓縮包
這是color theme的下載地址:
http://download.savannah.gnu.org/releases/color-theme/
這是color theme的WIKI:
http://www.emacswiki.org/emacs/ColorTheme
1.2 解壓並復制相應文件到.emacs.d/下
現在最新版本的應該是 color-theme-6.6.0,下載完畢之後解壓。
tar zxf color-theme-6.6.0.tar.gz
選擇其中的themes目錄和color-theme.el到.emacs.d/下。
cp -r themes color-theme.el ~/.emacs.d/
1.3 在~/.emacs加上如下代碼
;;將~/.emacs.d/添加到加載路徑
(add-to-list 'load-path "~/.emacs.d/")
(require 'color-theme)
(color-theme-initialize)
;; 這個是你選擇的主題,後面的calm forest就是它的名字,注意使用小寫。
(color-theme-calm-forest)
1.4 在Emacs中查看並選擇
打開Emacs後可以 M+X color-theme-select 選擇你喜歡的主題,然後將相應的名稱寫入.emacs中。