Eclipse shortcut keys
About shortcut keys
Many operations in Eclipse provide shortcut key functions. We can control various functions of Eclipse through the keyboard:
Use shortcut keys to associate menus or menu items
Use shortcut keys to associate dialog windows or views or editors
Use shortcuts Function buttons on the key association toolbar
The Eclipse shortcut key list can be opened with the shortcut Ctrl + Shift + L.
Set shortcut keys
The shortcut keys provided by the Eclipse system are sometimes difficult to remember, and even when there are no shortcut keys provided at all, you need to manually set the shortcut keys yourself.
We can enter the shortcut key management interface by clicking window->preferences->general->keys (or search keys directly):
Here you can find all When the function shortcut keys need to be modified or added, click on the command that needs to be modified or added, and set the shortcut keys in the binding:
After setting the shortcut keys, when can it be set? Using this shortcut key, eclipse provides various scenarios to choose from. Generally, In Windows (that is, activated in the eclipse window) can be selected.
Complete the above operations and click the OK button to complete the setting.
Eclipse common shortcut keys
Shortcut keys | Description |
---|---|
Edit | |
Ctrl+1 | Quick fix (the most classic shortcut key, needless to say, can solve many problems, such as import classes, try catch surrounds, etc.) |
Ctrl+Shift+F | Format the current code |
Add class import Import | |
Organization class import (it not only has the function of Ctrl+Shift+M, but also helps you remove useless imports, Very useful) | |
Redo (opposite of Undo Ctrl+Z) | |
Content assistance (it saves you so many keyboard strokes, it’s so commonly used) | |
Delete the current line or multiple lines | |
The interactive position between the current line and the following line (especially practical, you can save the need to cut and paste first) | |
The interactive position between the current line and the previous line (same as above) | |
Copy the current line to the next line (copy and increase) | |
Copy the current line to the previous line (copy and increase) | |
Insert a blank line next to the current line (the mouse can be at any position of the current line, not necessarily the last) | |
Comment the current line, press again to uncomment | |
Select the encapsulated element | |
Select the previous element | |
Select the next element | |
Select characters from the cursor to the left | |
From the cursor Start selecting characters to the right | |
Select the word to the left of the cursor | |
Select the word next to the cursor | |
Move the cursor to the beginning of the word on the left , equivalent to vim's b | |
, the cursor moves to the end of the word on the right, equivalent to vim's e | |
Refer to the selected word to quickly locate the next one (if no word is selected, search for the last word used to search) | |
Refer to the selected Word to quickly locate the previous one | |
Forward increase Quantitative search (after pressing Ctrl+J, the editor will provide a quick match for each letter you enter to locate a certain word. If not, it will display in the status bar that it is not found. This is especially useful when looking up a word. To exit this mode, press escape) | |
Reverse incremental search (same as the previous article, except that it searches from back to front ) | |
List all lines containing string | |
Open the search dialog | |
Declarations in the workspace | ##Ctrl+Shift+G |
Navigation | |
Ctrl+Shift+T | Search for classes (including projects and associated third jar packages) |
Ctrl+Shift+R | Search for files in the project |
Ctrl+E | Quickly display the drop-down list of the current Editor (if Those not shown on the current page are in bold) |
F4 | Open the type hierarchy |
F3 | Jump to the statement |
Alt+← | Previous edited page |
Alt+→ | Next edited page (of course, for the above one) |
Ctrl+PageUp/PageDown | In the editor, switch the open file |
Debugging | |
F5 | Single-step into |
F6 | Single step skip |
F7 | Single step return |
F8 | Continue |
Ctrl+Shift+D | Display the value of the variable |
Ctrl+Shift+B | In Set or remove breakpoints on the current line |
Ctrl+R | Run to the current line (very easy to use, can save a lot of breakpoints) |
Refactoring (generally the shortcut keys for refactoring start with Alt+Shift) | |
Alt+Shift+R | Rename the method name , attribute or variable name (this is my favorite one, especially the Rename of variables and classes, which can save a lot of labor than manual methods) |
Alt+Shift+M | Extract the code within a function into a method (this is one of the most commonly used methods in refactoring, especially useful for a lot of muddy code) |
Alt+Shift+C | Modify the function structure (more practical, there are N functions calling this method, modify it once) |
Extract local variables (you can directly extract some magic numbers and strings into a variable, especially when called from multiple places) | |
Change local variables in Class into field variables (a more practical function) | |
Merge variables (maybe it’s a bit inappropriate to say this) Inline) | |
Move functions and variables (less commonly used) | |
Reconstructed Regret Medicine (Undo) | |
Show current Select the properties of the resource. This shortcut key is used to view the properties of the file under Windows. It is usually used to view the actual path of the file in Windows | |
Text editing Scroll on the text editor | |
Scroll on the text editor | |
Maximize the current Edit or View (press again to do the opposite) | |
Quickly display OutLine (for students who do not open the Outline window, this shortcut key is Essential) | |
Quickly display the inheritance structure of the current class | |
Close the current Editor (the same is true for closing and opening the dialog box under Windows, as well as QQ, Wangwang, browsers, etc.) | |
Text editor go to line | |
F2 | Show tooltip description |