Become an Eclipse hotkey showoff
posted on 02 Jul 2008 11:26 by sukijblog in ToolsAndTrip
อ่ะนะ ไหนๆก็ไหนๆ ใช้งานเจ้า Eclipse มานาน การจะใช้ tools ให้ดีก็ต้องทำความชำนาญกับ tool นั้นหน่อย
อยากจะค้นหา resource ต่างๆ ด้วยความว่องไวก็เลยไปค้นหา hotkey จนเจอ ส่วนใหญ่เป็นในส่วน hotkey ที่น่าจะใช้ประจำในการทำงาน ด้วยเลยนำมาฝากครับ
(หรือว่าเผอิญเจอหว่า) เอาเป็น
ว่าไปดูกัน ไ่ม่แปลน่ะ - - ตรงๆจากของเค้าเลยแล้วกัน
Let's go through my favorites in order of most frequently used. (Note: these are tested in Eclipse version 3.02 and up.) อ้อ ใช้ version 3.02 ขึ้นไปน้า
- Control-Shift-T: Open type. Forget manually navigating through the source tree unless you're procrastinating.
- Control-Shift-R: Open resource (looks for more than just Java files).
A tip to go along with these first two combinations is in the Navigator view, accessed from the yellow double-arrowed Link With Editor icon. This will make the file you open appear in the navigator hierarchy, which is often good orientation information. Turn it off if things get too slow.
- F3: Open declaration. Alternatively, you can click on the Declaration tab (in the Java perspective, go to Window, then Show View, then Declaration). This key shows entire method declarations in the declaration pane when you click on a method call in the code.
- Alt-left arrow: Go back in navigation history. Works like a Web browser's back button and comes in handy after jumping around using F3.
- Alt-right arrow: Go forward.
- Control-Q: Go to last edit location. This key combination is also handy after you've been jumping around the code, especially if you've drilled down too deeply and have forgotten what you were doing.
- Control-Shift-G: Find references in workspace. Prerequisite to most refactors. For methods, this key combination is basically the opposite of F3, allowing you to navigate backwards up a method stack to find a method's callers. A feature related to this is turning on occurrence marking. Go to Window, then Preferences, then Java, then Editor, then Mark Occurrences and select a few checkbox options. This highlights all occurrences in the code when you click an element designated for marking. I personally only use Mark Local Variables. Beware: Enabling too many highlights can slow Eclipse.
- Control-Shift-F: Reformat code (according to code style settings). Our team agreed on a coding style, and we posted the Eclipse code style-rules files to our wiki. To do that, we sat together in Eclipse and went to Window, then Preferences, then Java, then Code Style, and configured Code Formatter, Code Templates, and Organize Imports. We used the Export function in each of these screens to generate the config files. We put these on the wiki and everyone imported them into their Eclipse.
- Control-O: Quick outline. Within the editor, this key combination allows you to jump to a method or attribute by typing a few letters of the name.
- Control-/: Comment/uncomment a line. Can also work on many lines at a time.
- Control-Alt-down arrow: Copy highlighted line(s).
- Alt-down arrow: Move line(s) down. Alt-up arrow works as well
ที่เหลือถ้าอย่างอื่นเต็มๆ นี่เยย
http://www.javaworld.com/javaworld/jw-08-2005/jw-0829-eclipse.html
ที่จริงโพสต์ไว้ก่อนกันลืมแหละเรา

