Skip to content

⌨️ Sample Document: Useful Keyboard Shortcuts in IntelliJ

IntelliJ IDEA is one of the most popular integrated development environments (IDE) for Java, but it also offers extensive support for many other programming languages. You can fully harness its potential by using the appropriate keyboard shortcuts, which significantly improve efficiency and speed of work. Below is an overview of some of the most useful keyboard shortcuts in IntelliJ.


General Shortcuts

  • Ctrl + Shift + A - Opens the "Find Action" dialog, which allows for quick searching of any actions, settings, and tools within the IDE.
  • Double Shift - Invokes the "Search Everywhere" feature, allowing you to search through all resources in the project and IDE.

Code Navigation

  • Ctrl + N / Cmd + O (macOS) - Quickly search for a class, which speeds up navigation in large projects.
  • Ctrl + Shift + N - Search for a file by name. Very useful when working with multiple source files.
  • Alt + F7 - Find Usages, which shows all places in projects where the selected element is used.
  • Ctrl + B / Cmd + B (macOS) - Go to the declaration of a variable, method, or class, greatly speeding up code analysis.

Code Editing

  • Ctrl + D - Duplicate the current line or selected code; helps save time when writing similar code snippets.
  • Ctrl + Y - Deletes the current line, useful for quick refactoring and cleaning up code.
  • Ctrl + / and Ctrl + Shift + / - Comment/uncomment one or multiple lines of code.
  • Ctrl + Alt + L - Reformat code according to project settings, ensuring code consistency and readability.

Accelerating Refactoring

  • Ctrl + Alt + C - Extract a constant from the selected code fragment, aiding in managing magic values.
  • Ctrl + Alt + M - Create a method from the selected code fragment; ideal for isolating logic and enhancing readability.
  • Ctrl + F6 - Refactor, rename variables, methods, or classes in all places where they are used.

Debugging

  • F8 - Step over to the next line, ignoring functions, allowing focus on the chosen code segment.
  • F7 - Step into the next line, entering functions, facilitating execution analysis.

Consolidated Workflows

  • Ctrl + Tab - Quickly switch between open tabs and windows in the IDE, fundamental for multitasking.
  • Alt + 1 - Switch to Project view, enabling quick navigation through the folder and file structure.

Using these keyboard shortcuts not only improves the flow of working with code but also reduces the time spent performing repetitive tasks, which is the foundation of effective programming with IntelliJ IDEA.