Eclipse 系列之常用默认快捷键
常用的 Eclipse 默认快捷键,总结如下:
源码类
这一类快捷键是我的最爱,可以极大的提高编程和重构效率。
| Command | Binding | Description |
|---|---|---|
| Quick Fix | Ctrl+1 | Suggest possible fixes for a problem |
| Content Assist | Alt+/ | 内容辅助(代码提示) |
| Show Source Quick Menu | Alt+Shift+S | 重构 |
| Rename | Alt+Shift+R | 重命名 |
| Extract Function | Alt+Shift+M | 抽取方法 |
| Organize Imports | Ctrl+Shift+O | 自动导入类包 |
搜索类
Eclipse 这类 IDE 区别于其它文本编辑器(如 Vim、UE、EP、Notepad2 等)的一大优势是拥有强大的引用和搜索功能。
| Command | Binding | Description |
|---|---|---|
| Incremental Find | Ctrl+J | 增量搜索 |
| Incremental Find Reverse | Ctrl+Shift+J | 反向搜索 |
| Go to Line | Ctrl+L | 定位到指定行 |
| Open Search Dialog | Ctrl+H | 打开搜索对话框 |
| Open Resource | Ctrl+Shift+R | 开发目标资源文件 |
| Open Call Hierarchy | Ctrl+Alt+H | 查找指定元素的调用栈 / Open a call hierarchy on the selected element |
| Show Occurrences in File Quick Menu | Ctrl+Shift+U | 在当前文件中查找指定元素的引用 |
| References in Workspace | Ctrl+Shift+G | 在工作空间中查找指定元素的引用 |
文本编辑类
偷懒者必备。
| Command | Binding | Description |
|---|---|---|
| Delete Line | Ctrl+D | 删除当前行 |
| Toggle Comment | Ctrl+/ | 注释当前行 |
| Move Lines Up | Alt+↑ | 将选定行上移 |
| Move Lines Down | Alt+↓ | 将选定行下移 |
| Duplicate Lines | Ctrl+Alt+↑ | 复制选定行 |
| Copy Lines | Ctrl+Alt+↓ | 复制选定行 |
| To Upper Case | Ctrl+Shift+X | 将所选区域字母设置为大写 |
| To Lower Case | Ctrl+Shift+Y | 将所选区域字母设置为小写 |
| Toggle Block Selection | Alt+Shift+A | 块编辑功能 / Toggle block / column selection in the current text editor |
其它类
| Command | Binding | Description |
|---|---|---|
| Backward History | Alt+← | 前一个编辑页面 / Move backward in the editor navigation history |
| Forward History | Alt+→ | 后一个编辑页面 / Move forward in the editor navigation history |
| Scroll Line Up | Ctrl+↑ | 向上滚动一行文本 / Scroll up one line of text |
| Scroll Line Down | Ctrl+↓ | 向下滚动一行文本 / Scroll down one line of text |
| Maximize Active View or Editor | Ctrl+M | 全屏 / Toggles maximize/restore state of active view or editor |
| Properties | Alt+Enter | Display the properties of the selected item |