Some useful Eclipse hotkey

本文详细介绍了在Eclipse中使用快捷键进行高效开发的方法,包括文件操作、导航、编辑、重构等常见任务的快捷组合,以及如何通过个性化设置提高开发效率。同时,文章还分享了团队统一的代码风格规范配置,以及如何利用Eclipse的资源查找、引用查找等功能,帮助开发者更快地定位代码问题和实现功能。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 
  1. Control-Shift-T: Open type. Forget manually navigating through the source tree unless you're procrastinating.
  2. 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.

  3. 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.
  4. Alt-right arrow: Go forward.
  5. 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.
  6. 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.
  7. 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.
  8. 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.
  9. Control-/: Comment/uncomment a line. Can also work on many lines at a time.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值