[Novice] eclipse shortcut key usage

Eclipse Shortcuts

Use shortcut keys on

Eclipse of many operations can use shortcut keys, shortcut keys can be more efficient than ordinary working novices. In fact, there are shortcuts in eclipse instructions, ①help> Key Assist. ② use the shortcut key ctrl + shift + L. After opening are English, so for the novice faster understanding Shortcuts This blogger, by using Chinese + down on the frequency of the gradient to introduce shortcuts.

Ctrl+1 Fixing Your Code
Ctrl+Shift+F The code format normalization
Ctrl+Shift+M Add class introduced import
Ctrl+Shift+O import introduction and removal of the added class useless introduced
Ctrl+Y Ctrl + Z to undo the contrary
Alt+/ Content Assist
Ctrl+D Delete the current line or multi-line
Alt+↓ The current line and the following line interactive location
Alt+↑ The current line and the top line of interaction locations
Ctrl + Alt + ↓ Copy the current line to the next line (Copy increase)
Ctrl + Alt + ↑ Copy the current line to the previous line (Copy increase)
Ctrl+/ Comments on the current line, press the Cancel comment
Shift+← From the left to select the character cursor at the beginning
Shift+→ Start right from the cursor to select a character
Ctrl+K Referring to the selected Word quickly navigate to the next (if not selected word, then search again using the search word)
Ctrl+Shift+K Word quickly locate the selected reference to a
Ctrl+J After the positive incremental find (press Ctrl + J, you enter each letter editor provides fast matching to locate a word, if not, then not found in the status bar, when a search word, particularly useful, to exit this mode, press the escape build)
Ctrl+Shift+J Reverse incremental find (and on the same strip, just forward from the back check)
Ctrl+Shift+U Lists all lines that contain the string
Ctrl+H Open the search dialog
Ctrl+Shift+T Search categories (including third jar package engineering and associated)
Ctrl+Shift+R Search project file
Ctrl+E Editer quickly display the drop-down list of the current (if the current page does not display shown in bold)
Alt+← A former editor of the page
Alt+→ Next edit page (of course, for the one above it)
Ctrl+PageUp/PageDown In the editor, switch open file
Ctrl+Shift+D The value of the variable display
Ctrl+Shift+B Line set or remove the breakpoint current
Ctrl+R Run to Line (super useful, you can save a lot of breakpoints)
Alt+Shift+R Rename the method name, property or variable name 
Alt+Shift+M Function within the code period into the extraction method 
Alt+Shift+C Structure modification function (more practical, with N function calls this method once get modified)
Alt+Shift+L Extraction local variables (can be directly put some magic numbers and strings drawn into a variable, especially when multiple calls)
Alt+Shift+F The Class of local variables into a field variable (more useful features)
Alt+Shift+I The combined variable (might say something wrong Inline)
Shift + Alt + Z Reconstruction of regret (Undo)
Ctrl+T Quick display the current class inheritance structure

7 Eclipse used to develop shortcuts tips

? 1, alt + or alt + /: auto-complete code or prompt code

After entering syso few characters, two fingers easily press the 2 key, the automatic on completion System.out.println ();, and it appears eclipse default method suggests that if the middle prompted broken. want to see in the front, then had to re-input the corresponding class or variable. can again see the prompt, but if this is to use a combination of two keys can also play a role prompt, and if the input for, if necessary top traversing local variables, the choose each traverse or use for  for (int ;;)  or  while ()  and then automatically generate code.

2, ctrl + page down or ctrl + page up: quick switch between tabs

Tab can view before and after

3, shift + enter and ctrl + shift + enter: Create a blank or below on the current line.

Shift+enter 在当前行之下创建一个空白行,与光标是否在行末无关。Ctrl+shift+enter 则在当前行之前插入空白行。

4、Control+Alt+方向上下键:复制高亮显示的一行或多行

能非常方便复制当前代码到上一行或者下一行

5、ctrl+m:当前编辑页面窗口最大化

Ctrl+m 是编辑器窗口最大化的快捷键,再按下就恢复正常窗口。

6、ctrl+/:自动注释当前行或者选择的多行

自动注释掉当前行或者多行代码,用 // 注释,用 ctrl+\ 可以取消注释。

7、ctrl+shift+/:自动注释掉选择的代码块

这个注意是用 /* */ 注释的(如果是编程语言代码),html,css 等也可以用这个注释,生成对应的注释标签,用 ctrl+shift+\ 可以取消注释。

 

附上一些小窍门:

锁定命令行窗口:在命令行视图中(Window -> Show View ->Other -> Basic -> Console),试试看用滚动锁定按钮来锁定控制台输出不要滚屏。

自动遍历一个集合:for + Control-Space: 如果你还不知道,那么你应该记住Control-Space是自动完成功能。在Eclipse中,你还可以自动完成结构。在一个数组或集合范围内,试试看 输入"for"然后按下Control-Space键。Eclipse会问你你想要遍历哪一个集合然后自动完成循环代码。

一次显示多个文件:你可以一次浏览多个文件。把不在激活状态的编辑窗口拖到激活窗口的底部或侧边的滚动条上,就可以打开该编辑窗口。

Implementors插件:安装一个能够跳到一个接口的实现的插件。

自动生成getter和setter方法:在对应的POJO中,右击空白处,选择【Source】,再选择【Generate Getters and Setters】,然后选择自己对哪些属性生成这样的方法,点击【确定】。

发布了24 篇原创文章 · 获赞 2 · 访问量 202

Guess you like

Origin blog.csdn.net/weixin_44570019/article/details/103838087