Reprint eclipse shortcut keys including finding classes, methods, variables

【Ct rl+T】

Search for the implementation class of the current interface

 

1. [ ALT  +/] 
   This shortcut key is a good helper for user editing, and can provide users with content assistance. Don't worry about not remembering all the names of methods and properties. When you can't remember all the names of classes, methods and properties, experience more.  Let's take a look at the benefits of the [ ALT +/] shortcut key.

   2. [C t  rl+O] 
   Displays the outline of the methods and properties in the class, which can quickly locate the methods and properties of the class, which is very useful when finding bugs.

   3. [C t  rl+/] 
   Quickly add a comment, which can quickly add or uncomment the line where the cursor is located or the selected line. You may always need to comment or uncomment something during debugging. Now it's good, no need Make repeated comments per line.

   4. 【C t  rl+D】 
   Delete the current line, which is also one of the author's favorites. You don't need to press the delete key so many times to delete a line.

   5. [C t  rl+M] 
   The window is maximized and restored. When users operate in the window, they always feel that the current window is small (especially when writing code). Now, try [C t  rl+M] hot key.

   View and locate shortcuts

   In the program, it is very difficult to quickly locate the location of the code and quickly find the location of the bug. Eclipse provides a powerful search function, and the following shortcut keys can be used to help complete the search and positioning work.

   1. [C t  rl+K], [C t  rl++Shift  +K]  to
   quickly search down and up the selected content, no longer need to click the search dialog box with the mouse.

   2. [C t  rl+Shift  + T  ]     Find the Java class files that can be found in the workspace (Workspace) build path, don't feel the pain of not being able to find the class, and you can use wildcards such as "*" and "?" .

   3. [C t  rl+Shift  + R] Find files    [C t  rl+Shift  + T ]  Find classes  , find all files (including Java files) in the workspace (Workspace), or use wildcards .  

   4. [C t  rl+Shift  +G]  Find references to classes, methods ,
   and properties. This is a very useful shortcut key. For example, if you want to modify the code that references a method, you can use the [C t rl+Shift + G ]  shortcut key to quickly locate all the locations that reference this method.

   5. [C t  rl+Shift  +O]  Quickly generate import t .  After copying a program from the Internet, I don't know how to import t  into the called class. Try [C t rl  +Shift  +O] shortcut key , there will be surprises.

   6. [C t  rl+Shift  +F]     Format the code, writing the code with the format specification is a compulsory course for every programmer. When you see a certain piece of code that is extremely unpleasant, select it and press 【C t rl + Shift +  F] shortcut key can format this code, if the code is not selected, the current file (Java file) will be formatted by default.

   7. [AL T  +Shift  +W]  Find the path in the project where the current file is
   located, you can quickly locate the location of the browser view, if you want to find the package where a certain file is located, this shortcut key is very useful (especially in relatively large project).

   8. [C t  rl+L] 
   locates a line in the current editor, which is also valid for non-Java files.

   9. 【Alt +←】、【Alt +→】 
   后退历史记录和前进历史记录,在跟踪代码时非常有用,用户可能查找了几个有关联的地方,但可能记不清楚了,可以通过这两个快捷键定位查找的顺序。

   10. 【F3】 
快速定位光标位置的某个类、方法和属性。

   11. 【F4】 
   显示类的继承关系,并打开类继承视图。

   调试快捷键

   Eclipse中有如下一些和运行调试相关的快捷键。

   1. 【Ct rl+Shift +B】:在当前行设置断点或取消设置的断点。 
   2. 【F11】:调试最后一次执行的程序。 
   3. 【Ct rl+F11】:运行最后一次执行的程序。 
   4. 【F5】:跟踪到方法中,当程序执行到某方法时,可以按【F5】键跟踪到方法中。 
   5. 【F6】:单步执行程序。 
   6. 【F7】:执行完方法,返回到调用此方法的后一条语句。 
   7. 【F8】:继续执行,到下一个断点或程序结束。

   常用编辑器快捷键

   通常文本编辑器都提供了一些和编辑相关的快捷键,在Eclipse中也可以通过这些快捷键进行文本编辑。 
   1. 【Ct rl+C】:复制。 
   2. 【Ct rl+X】:剪切。 
   3. 【Ct rl+V】:粘贴。 
   4. 【Ct rl+S】:保存文件。 
   5. 【Ct rl+Z】:撤销。 
   6. 【Ct rl+Y】:重复。 
   7. 【Ct rl+F】:查找。

   其他快捷键

   Eclipse中还有很多快捷键,无法一一列举,可以通过帮助文档找到它们的使用方式,另外还有几个常用的快捷键如下。 
   1. 【Ct rl+F6】:切换到下一个编辑器。 
   2. 【Ct rl+Shift +F6】:切换到上一个编辑器。 
   3. 【Ct rl+F7】:切换到下一个视图。 
   4. 【Ct rl+Shift +F7】:切换到上一个视图。 
   5. 【Ct rl+F8】:切换到下一个透视图。 
   6. 【Ct rl+Shift +F8】:切换到上一个透视图。

 

行注释/销注释 Ct rl+/ 

块注释/销注释 C t rl+Sh if t +/   C t rl+Sh if t +\
查找 查找替换 C t rl+H   C t rl+F
查找相关信息    ct rl  +  shift   +  t    通过类名来查找对应的类,包括在那个包,还有提示。
查找下一个/往回找 C t rl+K   C t rl+Sh if t +K
跳到某行 C t rl+L,哈用惯了Edi t plus,不时会敲下C t rl+G,
查找当前元素的声明  Ct rl+G 或者 Ct rl加鼠标左键
查找当前元素的所有引用  Ct rl+Sh ift +G
重新组织Impor t  Ct rl+Sh ift +O ,能帮你一次去掉所有未使用的Impor t 声明!
返回上一次查看的点  Ct rl+Q 看源码时很好用
复制一份代码 C t rl+Al t +下
快速修正 C t rl+1
引入某个类(接口)c t rl + sh if t + m
加头注释 sh if t + al t + j
 

ct rl  +  sh ift  +  g:查看引用  
ct rl  +  sh ift  +  n:重命名  
ct rl  +  sh ift  +  o:导入类  
ct rl  +  sh ift  +  r:启动上次运行  
ct rl  +  sh ift  +  f:格式化代码  
ct rl  +  c:复制  
ct rl  +  v:粘贴  
ct rl  +  x:切剪  
ct rl  +  a:全选  
ct rl  +  f:查找  
ct rl  +  z:撤销  
ct rl  +  y:重做  
ct rl  +  s:保存  
---------------------------------------------------------------  
 
用的最多的应该就是CT RL+SH IFT +S  
还有格式化用的也挺多。  
---------------------------------------------------------------  
 
ct rl  +  sh ift  +  f  格式化代码  
ct rl  +  sh ift  +  o  组织导入  
F3    打开声明  
Alt  +  sh ift  +  r    重命名变量  
 
---------------------------------------------------------------  
 
up  
---------------------------------------------------------------  
 
Alt +/        
 
---------------------------------------------------------------  
 
alt  +  left  
alt  +  righ t  
ct rl  +  q  
---------------------------------------------------------------  
 
ct rl  +  sh ift  +  g:查看引用  
ct rl  +  sh ift  +  n:重命名  
ct rl  +  sh ift  +  f:格式化代码  
ct rl  +  c:复制  
ct rl  +  v:粘贴  
ct rl  +  a:全选  
ct rl  +  f:查找  
ct rl  +  z:撤销  
ct rl  +  s:保存  
Alt    +  /  智能提示  
---------------------------------------------------------------  
 
ct rl  +  sh ift  +  g:查看引用  
ct rl  +  sh ift  +  n:重命名  
ct rl  +  sh ift  +  o:导入类  
ct rl  +  sh ift  +  r:启动上次运行  
ct rl  +  sh ift  +  f:格式化代码  
ct rl  +  c:复制  
ct rl  +  v:粘贴  
ct rl  +  x:切剪  
ct rl  +  a:全选  
ct rl  +  f:查找  
ct rl  +  z:撤销  
ct rl  +  y:重做  
ct rl  +  s:保存  
Alt    +  /  智能提示  
F3    打开声明  
Alt  +  sh ift  +  r    重命名变量  
其实最常用的就是下面几个:  
 
ct rl  +  sh ift  +  o:导入类  
 
ct rl  +  sh ift  +  f:格式化代码  
ct rl  +  c:复制  
ct rl  +  v:粘贴  
ct rl  +  x:切剪  
ct rl  +  z:撤销  
ct rl  +  s:保存  
Alt    +  /  智能提示  
 
---------------------------------------------------------------  
 
Ct rl+M:  工作区最大化/最小化  
Alt +/:    智能提示  
F3:          察看声明  
Crt l+1:  修正错误  
 
Sh ift +Alt +T :  重构  
Sh ift +Alt +M:  提取函数  
Sh ift +Alt +R:  重命名  
Sh ift +Alt +C:  更改函数标记  
 
Ct rl+Sh it f+F:  格式化代码  
 
---------------------------------------------------------------  
 
ct rl  +  sh ift  +  o:导入类  
at l  +  /:提示  
ct rl  +  sh ift  +  t :查找相关信息  
---------------------------------------------------------------  
 
Eclipse 快捷键指南                                                                          
编辑  
作用域            功能            快捷键  
全局            查找并替换            Ct rl+F  
文本编辑器            查找上一个            Ct rl+Sh ift +K  
文本编辑器            查找下一个            Ct rl+K  
全局            撤销            Ct rl+Z  
全局            复制            Ct rl+C  
全局            恢复上一个选择            Alt +Sh ift +↓  
全局            剪切            Ct rl+X  
全局            快速修正            Ct rl1+1  
全局            内容辅助            Alt +/  
全局            全部选中            Ct rl+A  
全局            删除            Delet e  
全局            上下文信息            Alt +?  
Alt +Sh ift +?  
Ct rl+Sh ift +Space  
Java编辑器            显示工具提示描述            F2  
Java编辑器            选择封装元素            Alt +Sh ift +↑  
Java编辑器            选择上一个元素            Alt +Sh ift +←  
Java编辑器            选择下一个元素            Alt +Sh ift +→  
文本编辑器            增量查找            Ct rl+J  
文本编辑器            增量逆向查找            Ct rl+Sh ift +J  
全局            粘贴            Ct rl+V  
全局            重做            Ct rl+Y  
   
查看  
作用域            功能            快捷键  
全局            放大            Ct rl+=  
全局            缩小            Ct rl+-  
   
窗口  
作用域            功能            快捷键  
全局            激活编辑器            F12  
全局            切换编辑器            Ct rl+Sh ift +W  
全局            上一个编辑器            Ct rl+Sh ift +F6  
全局            上一个视图            Ct rl+Sh ift +F7  
全局            上一个透视图            Ct rl+Sh ift +F8  
全局            下一个编辑器            Ct rl+F6  
全局            下一个视图            Ct rl+F7  
全局            下一个透视图            Ct rl+F8  
文本编辑器            显示标尺上下文菜单            Ct rl+W  
全局            显示视图菜单            Ct rl+F10  
全局            显示系统菜单            Alt +-  
   
导航  
作用域            功能            快捷键  
Java编辑器            打开结构            Ct rl+F3  
全局            打开类型            Ct rl+Sh ift +T  
全局            打开类型层次结构            F4  
全局            打开声明            F3  
全局            打开外部javadoc            Sh ift +F2  
全局            打开资源            Ct rl+Sh ift +R  
全局            后退历史记录            Alt +←  
全局            前进历史记录            Alt +→  
全局            上一个            Ct rl+,  
全局            下一个            Ct rl+.  
Java编辑器            显示大纲            Ct rl+O  
全局            在层次结构中打开类型            Ct rl+Sh ift +H  
全局            转至匹配的括号            Ct rl+Sh ift +P  
全局            转至上一个编辑位置            Ct rl+Q  
Java编辑器            转至上一个成员            Ct rl+Sh ift +↑  
Java编辑器            转至下一个成员            Ct rl+Sh ift +↓  
文本编辑器            转至行            Ct rl+L  
   
搜索  
作用域            功能            快捷键  
全局            出现在文件中            Ct rl+Sh ift +U  
全局            打开搜索对话框            Ct rl+H  
全局            工作区中的声明            Ct rl+G  
全局            工作区中的引用            Ct rl+Sh ift +G  
   
文本编辑  
作用域            功能            快捷键  
文本编辑器            改写切换            Insert  
文本编辑器            上滚行            Ct rl+↑  
文本编辑器            下滚行            Ct rl+↓  
   
文件  
作用域            功能            快捷键  
全局            保存            Ct rl+X    
Ct rl+S  
全局            打印            Ct rl+P  
全局            关闭            Ct rl+F4  
全局            全部保存            Ct rl+Sh ift +S  
全局            全部关闭            Ct rl+Sh ift +F4  
全局            属性            Alt +Ent er  
全局            新建            Ct rl+N  
   
项目  
作用域            功能            快捷键  
全局            全部构建            Ct rl+B  
   
源代码  
作用域            功能            快捷键  
Java编辑器            格式化            Ct rl+Sh ift +F  
Java编辑器            取消注释            Ct rl+  
Java编辑器            注释            Ct rl+/  
Java编辑器            添加导入            Ct rl+Sh ift +M  
Java编辑器            组织导入            Ct rl+Sh ift +O  
Java编辑器            使用t ry/cat ch 块来包围            未设置,太常用了,所以在这里列出,建议自己设置。  
也可以使用Ct rl+1自动修正。  
   
运行  
作用域            功能            快捷键  
全局            单步返回            F7  
全局            单步跳过            F6  
全局            单步跳入            F5  
全局            单步跳入选择            Ct rl+F5  
全局            调试上次启动            F11  
全局            继续            F8  
全局            使用过滤器单步执行            Sh ift +F5  
全局            添加/去除断点            Ct rl+Sh ift +B  
全局            显示            Ct rl+D  
全局            运行上次启动            Ct rl+F11  
全局            运行至行            Ct rl+R  
全局            执行            Ct rl+U  
   
重构  
作用域            功能            快捷键  
全局            撤销重构            Alt +Sh ift +Z  
全局            抽取方法            Alt +Sh ift +M  
全局            抽取局部变量            Alt +Sh ift +L  
全局            内联            Alt +Sh ift +I  
全局            移动            Alt +Sh ift +V  
全局            重命名            Alt +Sh ift +R  
全局            重做            Alt +Sh ift +Y 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326785040&siteId=291194637