This article will tell you about IDEA related shortcuts to location / handover / lookup.
Learn to use these shortcuts, you can leave as many fingers on the keyboard as possible, to avoid fingers between the mouse and keyboard to switch back and forth, to improve development efficiency.
1、Enter / return method shortcut key
Ctrl+B Enter where the cursor is defined or return where the method is used (instead of Ctrl + mouse click entry, it avoids finger switching between the keyboard and the mouse, a very useful shortcut key)
Ctrl+Alt+B Enter the place defined by a subclass or submethod.
Ctrl+F12 View all methods of the current class
Ctrl+H Displays the structure diagram of this class of inheritance relations.
Ctrl+Q Display doc annotation on class / method / variable
2、Cursor location and shortcut keys
Ctrl+Alt+Left/Right The cursor is located at the previous / next browse location.
Ctrl+Shift+Backspace The cursor is located in the place where it was last modified.
Alt+Up/Down Move the cursor to the beginning of the previous / next method.
Ctrl+Left/Right Move the cursor to the first / last word and add the Shift key to produce the selected effect.
Ctrl+[/] Move the cursor to the front / descendant block and add the Shift key to produce the selection effect.
Ctrl+W Select the code according to the syntax, continue to press will have other effects, add the Shift key, produce the reverse selection effect.
F2 Quickly locate the next error and warning point, add the Shift key, and locate the previous error.
Ctrl+”+/-“ The current method expands / folds, adds the Shift key, and all methods expand / fold.
Ctrl+Alt+T In the case of code selection, Surround With (if/else/try catch…) quickly encapsulated code.
Ctrl+Alt+V The content is selected as a local variable.
3、Delete / insert related shortcut keys
Ctrl+Backspace Delete by word
Ctrl+D Replicating line
Ctrl+Y Delete current row
Ctr+Shift+U Case conversion
Shift+Enter Insert the new row down, match the Ctrl key, first code and then insert the new line.
Ctrl+Alt+Enter Insert new rows upwards
Ctrl+Shift+Up/Down Move block / method in whole up / down
Alt+Shift+Up/Down One line up / down one line.
4、Positioning between files is quick.
Ctrl+E/Ctrl+Tab View / toggle the recently opened file (by selecting the arrow keys up and down, press Enter to enter).
ALT+Left/Right Left and right toggle in the open code editor window
5、Find related shortcuts
Ctrl+F/R Search / replace text under current file, add Shift key, search / replace text under current engineering path.
Ctrl+N Lookup class
Ctrl+Shift+N Lookup file
Ctrl+Shift+Alt+N Find methods or variables in classes
Shift+Shift Global lookup