eclipse shortcut keys

<div class="iteye-blog-content-contain" style="font-size: 14px"></div>

 Searching for eclipse shortcut keys on the Internet , you can find a lot of them. Most of them list more than n shortcut keys. It is estimated that most people will have a big head after reading it. I have a big head, but I tried them one by one and sorted them out. Since eclipse is the most commonly used and most useful, some shortcut keys that must be used to write code are only about half of the online shortcut keys, reducing the amount of memory for everyone. If everyone uses these shortcut keys well, the efficiency of writing code will definitely be improved. Of course, you can also view and modify shortcut key bindings through Window–>Preferences–>General–>Keys in the menu bar.

edit

Ctrl+1 Quick fix (the most classic shortcut, needless to say, can solve many problems, such as import class, try catch surround, etc.) Ctrl+Shift+F Format current code Ctrl+Shift+M Add class import Import Ctrl+Shift+O Organization class import import (both the role of Ctrl+Shift+M, and can help you remove useless imports, very useful) Ctrl+Y Redo (opposite to undo Ctrl+Z) Alt+/ Content assist (it saves you how many keystrokes, it's too common) Ctrl+D Delete the current line or multiple lines Alt+↓ The interaction position between the current line and the next line (especially practical, you can save cutting and pasting first) Alt+ ↑ The interactive position of the current line and the previous line (same as above) Ctrl+Alt+↓ Copy the current line to the next line (copy increase) Ctrl+Alt+↑ Copy the current line to the previous line (copy increase) Shift+Enter Insert a blank in the next line of the current line Line (the mouse can be at any position of the current line, not necessarily the last) Ctrl+/ Comment the current line, press again to cancel the comment











choose

Alt+Shift+↑ Select the encapsulated element Alt+Shift+← Select the previous element Alt+Shift+→ Select the next element Shift+← Select the character from the cursor to the left Shift+→ Select the character from the cursor to the right Ctrl+Shift+← Select the left of the cursor Ctrl+Shift+→ Select the word next to the cursor





move

Ctrl+← Move the cursor to the beginning of the word on the left, equivalent to vim's b Ctrl+→ Move the cursor to the end of the word on the right, equivalent to vim's e

search

Ctrl+K 参照选中的Word快速定位到下一个(如果没有选中word,则搜索上一次使用搜索的word)
Ctrl+Shift+K 参照选中的Word快速定位到上一个
Ctrl+J 正向增量查找(按下Ctrl+J后,你所输入的每个字母编辑器都提供快速匹配定位到某个单词,如果没有,则在状态栏中显示没有找到了,查一个单词时,特别实用,要退出这个模式,按escape建)
Ctrl+Shift+J 反向增量查找(和上条相同,只不过是从后往前查)
Ctrl+Shift+U 列出所有包含字符串的行
Ctrl+H 打开搜索对话框
Ctrl+G 工作区中的声明
Ctrl+Shift+G 工作区中的引用

导航

Ctrl+Shift+T 搜索类(包括工程和关联的第三jar包)
Ctrl+Shift+R 搜索工程中的文件
Ctrl+E 快速显示当前Editer的下拉列表(如果当前页面没有显示的用黑体表示)
F4 打开类型层次结构
F3 跳转到声明处
Alt+← 前一个编辑的页面
Alt+→ 下一个编辑的页面(当然是针对上面那条来说了)
Ctrl+PageUp/PageDown 在编辑器中,切换已经打开的文件

调试

F5 单步跳入
F6 单步跳过
F7 单步返回
F8 继续
Ctrl+Shift+D 显示变量的值
Ctrl+Shift+B 在当前行设置或者去掉断点
Ctrl+R 运行至行(超好用,可以节省好多的断点)

重构

(一般重构的快捷键都是Alt+Shift开头的了)
Alt+Shift+R 重命名方法名、属性或者变量名 (是我自己最爱用的一个了,尤其是变量和类的Rename,比手工方法能节省很多劳动力)
Alt+Shift+M 把一段函数内的代码抽取成方法 (这是重构里面最常用的方法之一了,尤其是对一大堆泥团代码有用)
Alt+Shift+C 修改函数结构(比较实用,有N个函数调用了这个方法,修改一次搞定)
Alt+Shift+L 抽取本地变量( 可以直接把一些魔法数字和字符串抽取成一个变量,尤其是多处调用的时候)
Alt+Shift+F 把Class中的local变量变为field变量 (比较实用的功能)
Alt+Shift+I 合并变量(可能这样说有点不妥Inline)
Alt+Shift+V 移动函数和变量(不怎么常用)
Alt+Shift+Z 重构的后悔药(Undo)

其他

Alt+Enter 显示当前选择资源的属性,windows下的查看文件的属性就是这个快捷键,通常用来查看文件在windows中的实际路径
Ctrl+↑ 文本编辑器 上滚行
Ctrl+↓ 文本编辑器 下滚行
Ctrl+M 最大化当前的Edit或View (再按则反之)
Ctrl+O 快速显示 OutLine(不开Outline窗口的同学,这个快捷键是必不可少的)
Ctrl+T 快速显示当前类的继承结构
Ctrl+W 关闭当前Editer(windows下关闭打开的对话框也是这个,还有qq、旺旺、浏览器等都是)
Ctrl+L 文本编辑器 转至行
F2 显示工具提示描述

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326294139&siteId=291194637