Most commonly used and practical
1. Alt + /
As a content auxiliary prompt, it is estimated that no one will use it. Of course, it can also be used to do some quick input, such as System.out.println(), which is most used by beginners. Just enter syso and press this key combination, and it will be automatically completed. Position the cursor within the brackets. In fact, some commonly used structures can be entered using this method, such as for, try...catch, etc., as long as they are defined in the preference java editor template, they can be used in this way.
2. Ctrl + Shift + O
Quickly and automatically import required packages.
3. Ctrl + D
Delete the current row or selected row.
4. Ctrl + /
Use single-line comments to comment/uncomment the current line or select a line. It is inevitable to temporarily close some code in the debugger, so its usage rate is quite high. Shortcut keys with similar functions include Ctrl + sift + / and Ctrl + sift + /, which can comment or cancel the selected part with multiple lines.
Practical and uncommon editing shortcut keys
1. Ctrl + Shift + Up Arrow/Down Arrow
Method to copy the current line or selected line to the previous/next line.
2. Alt + Up Arrow/Down Arrow
Let the current line swap positions with the previous/next line. Combined with the previous set of shortcut keys, you will find that copying and pasting code is very convenient.
3. Shift + Enter / Ctrl + Shift + Enter
Inserts an empty row below/previous to the current row and moves the cursor to the newly inserted row.
4. Ctrl + M
Maximize/unmaximize the current window, which is very convenient when the code is relatively long, without the hassle of switching between double-clicking the mouse.
5. Alt + Shift + R
Modify the variable or method name where the current cursor is located and automatically modify all references, which is very practical.
Uncommonly used positioning shortcut keys
1. Ctrl + K / Ctrl + Shift + K
Quickly search the selected content backward/forward in the current document. Although Ctrl + F can also be used, this is more convenient.
2. Alt + Left Arrow / Alt + Right Arrow
Back/forward to the last code position. This group is usually very convenient when you want to go back and look at the code after jumping to several classes or methods in succession.
3. Ctrl + Shift + T
Open the type and open the class in the JDK to view the source code.
4. Ctrl + Shift + G
You can check where the class, method or attribute where the cursor is located is referenced. This is rarely used because the code structure is very simple, but it will definitely be useful in the future.
Uncommonly used shortcut keys
1. Alt + Shift + S: Open the refactoring right-click menu and generate getter/setter methods, construction methods, and toString() methods.
2. Alt + Shift + Z: Put the selected code into while, for, try...catch and other structures
3. Ctrl + F6 / Ctrl + Shift + F6/Ctrl + E to switch to the previous/next editor or list editor display cards
4. F3 quickly locates the classes, methods, and properties of the cursor position.
5. F4 displays the inheritance relationship of the current class and opens the class inheritance view (or similar Ctrl + T to quickly display the inheritance relationship of the current class)
6. Ctrl + Q to locate the last edited position