【java】idea commonly used shortcut keys and shortcut codes!

1. Common shortcut code templates

* main method
  * psvm: public static void main(String[] args){}
  * main: public static void main(String[] args){}
* output statement
  * sout: System.out.println();
  * soutp: System.out.println("xxx :" + method parameter);
  * soutm: System.out.println("xx class. Current method name");
  * soutv: System.out.println("variable name = " + variable);
  * variable.sout: System.out.println("variable name = " + variable);
 

2. IDEA commonly used shortcut keys (Part 1)

* Comment out the selected line with a single-line comment: Ctrl + /
  * Select a single-line comment line, press Ctrl + / again to cancel the single-line comment
* Comment out the selected line with a multi-line comment: Ctrl + Shift + /,
  * Select the entire multi-line Press Ctrl + Shift + / again in the comment part to cancel multi-line comments

- Duplicate line: Ctrl + D
- Delete line: Ctrl + Y
- Cut line: Ctrl + X
- Rename class, variable, method, etc.: select the element to be renamed, press Shift + F6
- Format code: Ctrl + Alt + L
- Turn case: Ctrl + Shift + U
- Automatically declare variables to receive method call expression results: Ctrl + Alt + V
- Insert a blank line to start editing
  * Insert a blank line to start editing on the line below the current cursor: Shift + Back Cart
  * Insert a blank line on the line above the current cursor to start editing: Ctrl+Alt+Enter
- Move code
  * Move code up: Ctrl+Shift+↑ (Move the whole method) or Alt+Shift+↑ (Move line by line)
  * Down Move code: Ctrl+Shift + ↓ (moving the whole method) or Alt + Shift + ↓ (moving line by line)

- Smart Tips: Alt + Enter

- Folding and Expanding-
  Folding method implementation: Ctrl + Shift + -
  - Expanding method implementation: Ctrl + Shift + +
 

Guess you like

Origin blog.csdn.net/dxnn520/article/details/128695554