About shortcuts
Many of Eclipse's operations provide shortcut functionality, and we have good keyboard control over eclipse functions:
- Use shortcuts to associate menus or menu items
- Use shortcuts to associate a conversation window or view or editor
- Use shortcuts to associate feature buttons on the toolbar
The list of Eclipse shortcuts can be opened with the shortcut Ctrl, Shift, and L.
Set shortcuts
Eclipse systems sometimes provide shortcuts that are difficult to remember, or even require you to set them manually yourself when you don't even provide them at all.
We can access the shortcut management interface by clicking on window-gt; preferences-general-keys (or searching directly for keys:
Here you can find shortcuts for all features, and when you need to modify or add them, click on the commands that need to be modified or added to set the shortcuts in binding:
Once you've set the shortcut, you'll also need to set when you can use it, and eclipse offers a variety of scenarios to choose from, typically selecting In Windows (that is, activating the status in the eclipse window).
To complete the above, click the OK button to complete the setup.
Eclipse commonly uses shortcuts
Shortcuts | Describe |
---|---|
Edit | |
Ctrl+1 | Quick fix (the most classic shortcuts, need not say more, can solve a lot of problems, such as import class, try catch surrounded, etc.) |
Ctrl+Shift+F | Format the current code |
Ctrl+Shift+M | Add an import of the class's impport |
Ctrl+Shift+O | Organize the import of the import of the class (both Ctrl and Shift plus M, but also to help you remove useless imports, very useful) |
Ctrl+Y | Redo (as opposed to undoing Ctrl-Z) |
Alt+/ | Content aids (how many keyboard taps you save, too often) |
Ctrl+D | Delete the current row or multiple rows |
Alt+↓ | The current line interacts with the next line (especially useful to save cutting and pasting) |
Alt+↑ | Where the current row interacts with the top row (i.e.) |
Ctrl+Alt+↓ | Copy the current line to the next line (copy increase) |
Ctrl+Alt+↑ | Copy the current line to the last line (copy increase) |
Shift+Enter | Insert an empty line on the next line of the current line (at which point the mouse can be anywhere on the current line, not necessarily last) |
Ctrl+/ | Comment the current line, then press to uncomment |
Choose | |
Alt+Shift+↑ | Select the encapsulation element |
Alt+Shift+← | Select the last element |
Alt+Shift+→ | Select the next element |
Shift+← | Select the character to the left from the cursor |
Shift+→ | Select the character to the right from the cursor |
Ctrl+Shift+← | Select the word to the left of the cursor |
Ctrl+Shift+→ | Select the word to the right of the cursor |
Move | |
Ctrl+← | The cursor moves to the beginning of the word on the left, which is equivalent to vim's b |
Ctrl+→ | The cursor moves to the end of the word on the right, which is equivalent to vim's e |
Search | |
Ctrl+K | Quickly navigate to the next one with reference to the selected Word (if word is not selected, search for the word you last used) |
Ctrl+Shift+K | Quickly navigate to the last with reference to the selected Word |
Ctrl+J | Positive incremental lookup (after pressing Ctrl-J, each letter editor you enter provides a quick match to locate a word, if not, it is not found in the status bar, it is especially useful to check a word, to exit this mode, build by escape) |
Ctrl+Shift+J | Reverse incremental lookup (same as the previous bar, just check back) |
Ctrl+Shift+U | List all rows that contain strings |
Ctrl+H | Open the search dialog box |
Ctrl+G | The declaration in the workspace |
Ctrl+Shift+G | The reference in the workspace |
Navigation | |
Ctrl+Shift+T | Search class (including engineering and associated third jar package) |
Ctrl+Shift+R | Search for files in the project |
Ctrl+E | Quickly display the current Hiter's pull-down list (if the current page is not displayed in bold) |
F4 | Open the type hierarchy |
F3 | Jump to the declaration |
Alt+← | The previous edited page |
Alt+→ | The next edited page (for the one above, of course) |
Ctrl+PageUp/PageDown | In the editor, switch files that are already open |
Debugging | |
F5 | Step in |
F6 | Step-by-step skip |
F7 | Step back |
F8 | Go on |
Ctrl+Shift+D | Displays the value of the variable |
Ctrl+Shift+B | Set or remove break points in the current row |
Ctrl+R | Run to line (super good use, can save a lot of break points) |
Refactoring (generally refactored shortcuts start with Alt-Shift) | |
Alt+Shift+R | Rename method names, attributes, or variable names (one of my favorites, especially Rename for variables and classes, saves a lot of labor than manual methods) |
Alt+Shift+M | Extract code within a function into methods (this is one of the most common methods in refactoring, especially for a lot of mud code) |
Alt+Shift+C | Modifying the function structure (more practical, N functions call this method, modify it once) |
Alt+Shift+L | Extract local variables (some magic numbers and strings can be extracted directly into one variable, especially when multiple calls are made) |
Alt+Shift+F | Turn the local variable in Class into a field variable (more useful feature) |
Alt+Shift+I | Merge variables (maybe it's a little inappropriate to say that Inline) |
Alt+Shift+V | Move functions and variables (not very commonly used) |
Alt+Shift+Z | Reconstructed Regret Medicine (Undo) |
Other | |
Alt+Enter | Displays the properties of the currently selected resource, the properties of the viewing file under windows, which are the shortcuts that are typically used to see the actual path of the file in windows |
Ctrl+↑ | The text editor rolls up the line |
Ctrl+↓ | The text editor scrolls down the line |
Ctrl+M | Maximize the current Edit or View (re-press the opposite) |
Ctrl+O | Quickly display OutLine (students who don't open outline windows, this shortcut is essential) |
Ctrl+T | Quickly display the inheritance structure of the current class |
Ctrl+W | Close the current Editer (the dialog box that opens under windows is also this, as well as qq, Wangwang, browser, etc.) |
Ctrl+L | The text editor moved to the line |
F2 | Displays a description of the tool tip |