IDEA common shortcut keys & tips

preface

The blog used for the weak chicken review consolidation, lay a solid foundation, but also hope that the big guy is generous to give advice.

Common Shortcut keys

Bond order function note
Crtl+E Recently accessed files
Crtl+Shift+E The most recently edited file
Crtl+F12 The structure of properties and methods in the current class file
Alt+Home Jump to Navigation
Crtl+Home To the top of the current page
Crtl+End To the bottom of the current page
Crtl+N Jumps to the specified class Class name: number of rows up to the specified line of the specified class
Crtl+Shift+N Jumps to a specified file or directory
Crtl+Shift+Alt+N Jump to the specified Symbol Important; See Supplement 1 for details.
Crtl+Shift+T Jump to the associated unit tests If not, the generate unit test box will pop up
Crtl+U Jump to the upper tier Parent class or interface, etc
Crtl+Alt+B Jump to the lower level Methods to implement the interface; The source code of the called method, etc
Crtl+B Locate where a variable or method is referenced
Crtl+Shift+H All classes that implement or override the current method Structured display
Crtl+H The hierarchy of the current class, showing the tree relationship between the current class and other related classes The small icon in the upper left corner determines which tree structure to display
Crtl+Alt+U UML graphical display of the previous shortcut function
Crtl+Alt+H Method call hierarchy Shows where the method is called
Alt+Crtl+F7 Displays references to the current parameter or method
Crtl+Alt+Home Reference to the current parameter or method in an XML or view configuration file
Crtl+Alt+L Reformat Code
Crtl+Shift+Alt+L Show Reformat Code Dialog
Crtl+Insert Generate get,set,toString, and other methods
Crtl+Shift+V Adhesive board history
Shift+F6 Select edit the same text field
Crtl+/ Comment line
Crtl+Shift+/ Code block comment
Crtl+Shift+Alt+V Unformatted paste
Custom code abbreviation completion Complete the code by sout, PVSM and other fields See Supplement 2 for details.
Escape strings using Inject Escape the JSON format in the string via JSON See Supplement 3 for details.

supplement

Add 1

  • IDEA always maintains an index of all symbols in the project and library, so no matter how large the project is, it can easily find matching methods or fields in seconds by pressing Ctrl+Shift+Alt+N.

Add 2

  • Settings, search for Live Templates, and edit the Templates group where the Java(if not, click right + New Group) tag is located

    Click + on the right to add templates


    On the right, add a template group
  • Click + to add a new template


    Add a new template on the right


    Add page
  • As shown, add an abbreviation named PSVM that declares the main method, then click Define to Define its template group
Fill in the relevant information


Choose the Java
  • The effect

    Directly type PSVM, automatic completion will appear


    The code after completion
  • Other also like

Add 3

  • Cursor in string quotes, Alt+Enter select Inject Language or Reference and press Enter
  • I’m gonna go ahead and hit JSON
  • Alt+Enter again and select Edit Json Fragment
  • Enter in Json format in the window that pops up below, and the string above is automatically escaped from the quotes

P.S.

  • Due to the input method, QQ and other software, some shortcut keys may be overwritten or changed. It is best to cancel the shortcut keys that are not used in other software. For details about shortcut keys adjustment, see Settings –> Keymap
  • Here is the official shortcut reference document: Intellijidea_referencecard.pdf: https://resources….
  • Many of the shortcut instructions are not always easy to understand, but you’ll find out if you try.