2013年8月3日 星期六

Eclipse 修改程式碼編輯器佈景主題 - 使用 Eclipse Color Theme

由於平常就長時間盯著螢幕,通常程式編輯器的預設顏色都是白底黑字,由於螢幕背光的關係,長時間看著螢幕白底發出的強光對眼睛是一種傷害,因此我也就喜歡把所有常用的編輯器(包含文字編輯器)都改成黑底的。

早期要修改 Eclipse 的佈景主題比較麻煩,甚至要自己修改,現在有了 Eclipse Color Theme 的外掛程式,一切變得簡單容易:

Eclipse Color Theme
http://eclipsecolorthemes.org

P.S 筆者使用的開發環境是使用 Google 提供的 ADT(Android Develop Tool),它是由 Google 自行整合 Android 開發工具後的客製化 Eclipse,它和 Eclipse 官網下載的介面會有些不一樣,不過基本上是差不多的。

先開啟 Eclipse 然後找到選單 Help | Install New Software...
P.S. Eclipse 官網下載的版本,Help 選單底下會有一個 Eclipse Marketplace,裡面也可以直接搜索到 Eclipse Color Theme 的外掛程式,安裝更為方便。

點選 Add

Name 輸入 Eclipse Color Theme
Location 輸入 http://eclipse-color-theme.github.com/update

按下OK後,就可以看到 Eclipse Color Theme 的套件,勾選後點選 Next

按下 Next 確定安裝

同意授權,勾選 I accept the terms of the license agreement

安裝中
如果確定安裝來源沒問題,請按下OK。
安裝完畢,必須重新啟動 Eclipse,點選 Yes


 接下來,我們到選單中的 Windows | Preferences
在 General | Appearance 就會出現 Color Theme 的選項,裡面就有網站上提供的各種範例可以直接下使用,並且隨時都可以切換,比起早期使用匯入設定檔案的方式方便許多了。

選個黑色的並且馬上來使用看看吧,筆者使用的是 Oblivion 這一個,也是網站上下載率最高的版本。

除了修改好程式碼編輯器的佈景主題之外,還需要修改一下字形及大小,預設的字體非等寬字,而且大小也有點太小,看起來吃力。

在同一個設定畫面底下 General | Appearance 有一個 Colors and Fonts
找到底下的 Text Font 這一個是跟程式碼字體本身有關係的,點選兩下,或者選擇後點 Edit。


筆者喜歡的字形是 Consolas,大小改為 12

P.S.如果沒有這個字形,請至微軟官方網站下載:
http://www.microsoft.com/en-us/download/details.aspx?id=17879


按下確定後就可以觀看結果了!

不過只改好編輯器的部分,其他的部分仍然是白色的似乎對比有點強烈,後來找到了提供該佈景主題的作者,發現他寫了一個完整的佈景主題

Dark Juno - Dark UI Theme for Eclipse 4+
http://rogerdudler.github.io/eclipse-ui-themes/

根據該網站提供的連結下載佈景主題檔案
https://github.com/downloads/rogerdudler/eclipse-ui-themes/com.github.eclipsecolortheme.themes_1.0.0.201207121019.zip

解壓縮後,裡面會有一個 jar 的檔案,請將它複製到 Eclipse 安裝目錄底下的 dropins 資料夾內。

然後重新啟動,在 Windows | Preferences 設定選項內找到 General | Appearance
Theme 的部分選擇 Dark Juno,點選OK後,會要求重新啟動程式以顯示完整的效果。


完成效果,是不是很棒的感覺啊!


17 則留言:

  1. 我也是喜歡改 theme 和字型的人
    感謝介紹 Dark Juno
    字型這裡有一篇不錯的介紹,可以預覽 http://www.slant.co/topics/67/~what-are-the-best-programming-fonts

    回覆刪除
  2. 太實用了!我覺得眼睛不再刺刺了 XD 謝謝

    回覆刪除
  3. 不好意思我想問一下你會不會遇到Package Explorer、Outline、跟debug區標籤變亂碼的狀況呢
    我只要一套用Dark Juno那幾個區域就會變成亂碼,調回預設的appearance theme就變回來

    回覆刪除
    回覆
    1. 目前還沒遇過這樣的情形呢,試著把workspace資料備份後刪除,重新設定一次Eclipse,或者整個重新下載看看。

      刪除
    2. 把color Theme調整成其它任一種之後再回去調回來就可以了

      刪除
  4. 不好意思~想問一下
    為什麼我把.jar檔移到dropins資料夾後
    重開eclipse還是沒有看到上圖中的 "Dark Juno" 的選擇頁面呢?
    看到的還是原本的Apperance畫面

    回覆刪除
  5. 感謝版主分享的套件很實用
    不然每次手動條顏色都快瘋掉了

    回覆刪除
  6. Awesome post
    In the Shortest period of time to visit and feel the freshness of Taj Mahal You can choose a option of
    Same Day Jaipur Tour By Car. In 12 hours tour of Agra from Delhi which covered 3 World UNESCO and historical monuments of Agra which is Taj Mahal, Agra Fort And Baby Taj ( Itimad-ud-daulah).
    We have more packages like...
    Same Day Jaipur Tour By Train
    Same Day Agra Tour By Train
    Golden Triangle Tour 3 Night And 4 Days

    回覆刪除
  7. 請問我套用了以後顏色沒有更換是為什麼呢?
    有重啟過了

    回覆刪除
  8. Visit the historical city of India and also see the beauty of Taj Mahal in the reflection of Sun in our Sunrise Tour of Taj Mahal.

    回覆刪除
  9. Amazing post thanks for this information you describe it so easy way keep sharing...
    any one can explore INDIA visit us we are PACIFIC TOUR INDIA join us
    Some Packages:-
    Golden Triangle Tour 5 Days

    Golden Triangle Tour 6 Days

    Golden Triangle Tour 4 Days

    Golden Triangle & Varanasi

    Golden Triangle & Ranthambore

    for more information contact us
    CONTACT INFO
    Shop No.16, First Floor, Prerna Plaza, Fatehabad Road, Agra- 282001
    Mob : +91 - 9759747417, 9568617417
    Email: info@pacifictourindia.com,
    Web-side: www.pacifictourindia.com

    回覆刪除