Common shortcuts for eclipse

Searching for eclipse shortcut keys on the Internet, you can find a lot of them. Most of them list more than n shortcut keys. It is estimated that most people will have a big head after reading it. I have a big head, but I tried them one by one and sorted them out. Since eclipse is the most commonly used and most useful, some shortcut keys that must be used to write code are only about half of the online shortcut keys, reducing the amount of memory for everyone. If everyone uses these shortcut keys well, the efficiency of writing code will definitely be improved. Of course, you can also view and modify shortcut key bindings through Window–>Preferences–>General–>Keys in the menu bar.

Edit

Ctrl+1 Quick fix (the most classic shortcut, needless to say, can solve many problems, such as import class, try catch surround, etc.)
Ctrl+Shift+F Format current code
Ctrl+Shift+M Add class import import
Ctrl+Shift+O Organize import import of class (both the role of Ctrl+Shift+M, and can help you remove useless imports, very useful)
Ctrl+Y Redo (opposite to undo Ctrl+Z)
Alt+ / Content assist (it saves you a lot of keystrokes, it's too common)
Ctrl+D Delete the current line or multiple lines
Alt+↓ The interaction position between the current line and the next line (especially practical, you can save cutting and pasting first)
Alt+↑ the current line and the previous line interactive position (same as above)
Ctrl+Alt+↓ Copy the current line to the next line (copy increase)
Ctrl+Alt+↑ Copy the current line to the previous line (copy increase)
Shift+Enter Insert the next line of the current line Empty line (at this time the mouse can be anywhere in the current line, not necessarily the last)
Ctrl+/ Comment the current line, press again to cancel the comment

Select

Alt+Shift+↑ Select the encapsulated element
Alt+Shift+← Select the previous element
Alt+Shift+→ Select the next element
Shift+← Select the character from the cursor to the left
Shift+→ Select the character from the cursor to the right
Ctrl+Shift+← Select the cursor The word on the left
Ctrl+Shift+→ Select the word on the side of the cursor

Move

Ctrl+← Move the cursor to the beginning of the word on the left, which is equivalent to vim's b
Ctrl+→ Move the cursor to the end of the word on the right, which is equivalent to vim's e

Search

Ctrl+K Refer to selection Quickly navigate to the next word in Word (if the word is not selected, search for the word that was used last time)
Ctrl+Shift+K Refer to the selected Word to quickly locate to the previous
Ctrl+J Forward incremental search (press Ctrl+J After that, each letter editor you enter provides quick matching to locate a certain word. If not, it will display not found in the status bar. It is especially useful when looking up a word. To exit this mode, press escape to create )
Ctrl+Shift+J Reverse incremental search (same as the previous one, but from back to front)
Ctrl+Shift+U List all lines containing strings
Ctrl+H Open search dialog
Ctrl+G Work Declarations in the area
Ctrl+Shift+G References in the workspace

Navigation

Ctrl+Shift+T Search for classes (including projects and associated third jars)
Ctrl+Shift+R Search files in the project
Ctrl+E Quickly display the drop-down list of the current Editor (if the current page is not displayed in bold)
F4 Open the type hierarchy
F3 Jump to the declaration
Alt+← Previous edited page
Alt+ → The next edited page (of course for the above one)
Ctrl+PageUp/PageDown In the editor, switch the open file

Debug

F5 Step into
F6 Step over
F7 Step back to
F8 Continue
Ctrl +Shift+D Display the value of the variable
Ctrl+Shift+B Set or remove the breakpoint in the current line
Ctrl+R Run to the line (super easy to use, can save a lot of breakpoints)

Refactoring

(the shortcut keys for general refactoring are Alt+Shift starts with)
Alt+Shift+R Rename method name, property or variable name (it 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 in a function into a method (this is one of the most common methods in refactoring, especially useful for a lot of mud code)
Alt+Shift+C Modify the function structure (more practical, there are N functions call this method, modify it once)
Alt+Shift+L Extract local variables (you can directly extract some magic numbers and strings into a variable, especially when multiple calls)
Alt+Shift+F Change local variables in Class to field variables (a more practical function)
Alt+Shift+I Merge variables (it may be a bit inappropriate to say Inline)
Alt+Shift+V Move functions and variables (not very commonly used ) )
Alt+Shift+Z Refactored regret medicine (Undo)

Other

Alt+Enter Displays the properties of the currently selected resource, and the properties of the file under Windows is the shortcut key, which is usually used to view the actual path of the file in Windows
Ctrl+↑ Text Scroll up the editor
Ctrl+↓ Scroll down the text editor
Ctrl+M Maximize the current Edit or View (press again and vice versa)
Ctrl+O Quickly display OutLine (for students who do not open the Outline window, this shortcut key is essential )
Ctrl+T Quickly display the inheritance structure of the current class
Ctrl+W Close the current Editor (the same is true for closing the open dialog box under windows, as well as qq, Wangwang, browser, etc.)
Ctrl+L Text editor go to line
F2 Display tooltip description
**************************** To be added

Guess you like

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