Eclipse環境設定
文摘
http://www.ewdna.com/2011/09/eclipse.html
http://itekblog.com/code-folding-in-eclipse-tutorial/
folding tools
The Coffee-Bytes plugin by Alex Popescu can add folding functionality to Eclipse IDE.
download link is here.
the .zip file should contain a “com.cb.eclipse.folding” folder. extract it to “eclipse\plugins”, so you should have now a “c:\eclipse\plugins\com.cb.eclipse.folding\” folder with several files inside.
Is there a way to collapse all code blocks in Eclipse?
There is a hotkey, mapped by default to Ctrl+Shift+NUM_KEYPAD_DIVIDE.
You can change it to something else via Window -> Preferences, search for "Keys", then for "Collapse All".
To open all code blocks the shortcut is Ctrl+Shift+NUM_KEYPAD_MULTIPLY.
go to line number N in the source file: Ctrl + L
in Eclipse you can use Shift+Alt+↑ to mark the surrounding block to the current block
(and Shift+Alt+↓ to narrow down again).
Then ← will place you at the beginning of the block, and → at the end.
(Untested, from memory, but VERY handy).
預設編碼
顯示行號
調整字體大小
程式自動完成
首先預設編碼的地方除了 IDE workspace console 本身的編碼外,
還要設定預設的 html, css, jsp 等的預設編碼,
他們修改的路徑如下:
workspace:Window->Preferences->General->Workspace
右方 Text file encoding,建議改為 UTF-8
html:Window->Preferences->Web->HTML files
右方 encoding
css:Window->Preferences->Web->CSS files
右方 encoding
jsp:Window->Preferences->Web->JSP files
右方 encoding
顯示行號則可在 Window->Preferences->General->Editor,
右方 show line numbers 勾選。
除了上面的編碼和顯示行號的設定外,
因為每天寫程式用眼過度對眼睛實在很偒,
所以記得要去調整一下字體的大小喔!
調整的地方在:Window->Preferences->Corlors and Fonts->Java->Java Editor Text Font
如果要調整所有的字體的設定的話則可以在:
Window->Preferences->Corlors and Fonts->Basic->Text Font 調整,
預設 Java Editor Text Font 就會引用 Basic 的設定
另外我們在寫程式時常常需要用到自動完成的功能,
除了讓我們不用打那麼多字外,也省去打錯字修正的麻煩。
Eclipse 預設在使用時輸入 . 會帶出自動完成,
否則就要自己輸入「Alt + /」來呼叫,
雖然有快捷鍵,但有沒有辦法像 . 一樣輸入每個字都自動完成呢?
方法如下:
工具列 Windows -> Preferences -> Java -> Editor -> Content Assist
勾選 "Enable auto-activation"
Auto activation delay 為提示出現的延遲時間,可以設為 0
Auto activation triggers for Java 為遇到何種字元會自動啟動提示,預設只有 dot,請改為 .abcdefghijklmnopqrstuvwxyz(,
完成環境設定後若想加入套件 (plugin),請參考:
Eclipse新增、更新與移除套件(Plugin)教學
留言