Eclipse tutoria...login
Eclipse tutorial
author:php.cn  update time:2022-04-13 14:09:28

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

shortcuts_menu.jpg

The Eclipse shortcut key list can be opened with the shortcut Ctrl + Shift + L.

shortcuts_keys.jpg

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):

shortcut1

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: shortcut2

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.

shortcut3

Complete the above operations and click the OK button to complete the setting.


Eclipse common shortcut keys

##Ctrl+Shift+MAdd class import ImportCtrl+Shift+OOrganization class import (it not only has the function of Ctrl+Shift+M, but also helps you remove useless imports, Very useful) Ctrl+YRedo (opposite of Undo Ctrl+Z)Alt+/Content assistance (it saves you so many keyboard strokes, it’s so commonly used)Ctrl+DDelete the current line or multiple linesAlt+↓The interactive position between the current line and the following line (especially practical, you can save the need to cut and paste first) Alt+↑The interactive position between the current line and the previous line (same as above)Ctrl+Alt+↓Copy the current line to the next line (copy and increase) Ctrl+Alt+↑Copy the current line to the previous line (copy and increase) Shift+EnterInsert a blank line next to the current line (the mouse can be at any position of the current line, not necessarily the last) Ctrl+/ Comment the current line, press again to uncommentSelectAlt+Shift+↑Select the encapsulated elementAlt+Shift+←Select the previous element##Alt+Shift+→Shift+←Shift+→Ctrl+Shift+←Ctrl+Shift+→MoveCtrl+←Ctrl+→ search Ctrl+KCtrl+Shift+KCtrl+JCtrl+Shift+JCtrl+Shift+UCtrl+HCtrl+G##Ctrl+Shift+GReferences in workspace##Alt+Shift+LExtract local variables (you can directly extract some magic numbers and strings into a variable, especially when called from multiple places)Alt+Shift+FChange local variables in Class into field variables (a more practical function)Alt+Shift+IMerge variables (maybe it’s a bit inappropriate to say this) Inline)Alt+Shift+VMove functions and variables (less commonly used)Alt+Shift+ ZReconstructed Regret Medicine (Undo)OthersAlt+EnterShow 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 Ctrl+↑Text editing Scroll on the text editorCtrl+↓Scroll on the text editorCtrl+MMaximize the current Edit or View (press again to do the opposite) Ctrl+OQuickly display OutLine (for students who do not open the Outline window, this shortcut key is Essential) Ctrl+TQuickly display the inheritance structure of the current classCtrl+WClose the current Editor (the same is true for closing and opening the dialog box under Windows, as well as QQ, Wangwang, browsers, etc.) Ctrl+LText editor go to line
Shortcut keysDescription
Edit
Ctrl+1Quick fix (the most classic shortcut key, needless to say, can solve many problems, such as import classes, try catch surrounds, etc.)
Ctrl+Shift+FFormat the current code
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
Navigation
Ctrl+Shift+TSearch for classes (including projects and associated third jar packages)
Ctrl+Shift+RSearch for files in the project
Ctrl+EQuickly display the drop-down list of the current Editor (if Those not shown on the current page are in bold)
F4Open the type hierarchy
F3Jump to the statement
Alt+←Previous edited page
Alt+→Next edited page (of course, for the above one)
Ctrl+PageUp/PageDownIn the editor, switch the open file
Debugging
F5Single-step into
F6Single step skip
F7Single step return
F8 Continue
Ctrl+Shift+DDisplay the value of the variable
Ctrl+Shift+BIn Set or remove breakpoints on the current line
Ctrl+RRun 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+RRename 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+MExtract 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+CModify the function structure (more practical, there are N functions calling this method, modify it once)
F2Show tooltip description

php.cn