idea tips

  • To open any class in the editor quickly, press Ctrl+N (Navigate | Class) and start typing the name of the class. Choose the class from a drop-down list that appears.
  • The Code Completion feature lets you quickly complete different kinds of statements in the code. For example, start typing a class name and press Ctrl+空格 to complete it. When multiple choices are available, they are shown in the lookup list.
  • You can quickly find all places where a particular class, method or variable is used in the whole project by positioning the caret at the symbol’s name or at its usage in code and pressing Alt+F7 (Edit | Find | Find Usages in the popup menu).
  • To quickly see the documentation for a class or method at caret, press Ctrl+Q (View | Quick Documentation).
  • To navigate to the declaration of a class, method or variable used somewhere in the code, position the caret at the usage and press Ctrl+B (Navigate | Declaration). You can also click the mouse on usages with the Ctrl key pressed to jump to declarations.
  • You can quickly navigate in the currently edited file with Ctrl+F12 (Navigate | File Structure).
    It shows the list of members of the current class. Select an element you want to navigate to and press the Enter key or the F4 key.
    To easily locate an item in the list, just start typing its name.
  • You can easily rename your classes, methods and variables with automatic correction of all places where they are used.
    To try it, place the caret at the symbol you want to rename, and press Shift+F6 (Refactor | Rename). Type the new name in the popup window that appears, or select one of the suggested names, and press Enter.
  • You may easily override methods of the base class by pressing Ctrl+O (Code | Override Methods).
    To implement methods of the interfaces that the current class implements (or of the abstract base class), use Ctrl+I (Code | Implement methods).
  • The SmartType code completion greatly helps to find methods and variables that are suitable in the current context, by analyzing the expected type of the whole expression. So doing, IntelliJ IDEA pinpoints the top five most suitable results and highlights them on the blue background. For example, type

and press Ctrl+Shift+空格:

  • Using Alt+Insert (Code | Generate) in the editor, you can easily generate getter and setter methods for any fields of your class.
  • To quickly select the currently edited element (class, file, method or field) in any view (Project view, Structure view or other), press Alt+F1.
  • When you want to catch exceptions thrown by some code fragment, select it in the editor, press Ctrl+Alt+T (Code | Surround With) and choose try / catch. The catch blocks for all the exceptions thrown inside the block will be generated automatically.
    You can customize the bodies of the generated catch blocks on the Code tab of File | Settings | File and Code Templates.
    Use other items in the list to surround with other constructs.