IntelliJ IDEA Shortcuts

a computer keyboard has different colors on the keys and numbers and features red, green, white and blue

Note: this page has been created with the use of AI. Please take caution, and note that the content of this page does not necessarily reflect the opinion of Cratecode.

IntelliJ IDEA is a popular integrated development environment (IDE) for Java programming, and knowing its shortcuts can give your productivity a significant boost. We've compiled a list of keyboard shortcuts to help you navigate, edit, and manage your code with ease. Buckle up and let's dive into the world of IntelliJ IDEA shortcuts!

Navigation Shortcuts

Finding your way through the code jungle becomes a breeze with these navigation shortcuts.

  • Go to class: Ctrl + N (Windows/Linux), Cmd + N (Mac)
  • Go to file: Ctrl + Shift + N (Windows/Linux), Cmd + Shift + N (Mac)
  • Go to symbol: Ctrl + Shift + Alt + N (Windows/Linux), Cmd + Shift + Alt + N (Mac)
  • Go to line: Ctrl + G (Windows/Linux), Cmd + L (Mac)
  • Go to declaration: Ctrl + B (Windows/Linux), Cmd + B (Mac)
  • Go to implementation: Ctrl + Alt + B (Windows/Linux), Cmd + Alt + B (Mac)
  • Go to definition: Ctrl + Shift + B (Windows/Linux), Cmd + Shift + B (Mac)
  • Go to next/previous error: F2 / Shift + F2 (Windows/Linux), F2 / Shift + F2 (Mac)

Editing Shortcuts

Cruise through your code and make changes in the blink of an eye with these editing shortcuts.

  • Duplicate line: Ctrl + D (Windows/Linux), Cmd + D (Mac)
  • Delete line: Ctrl + Y (Windows/Linux), Cmd + Backspace (Mac)
  • Move line up/down: Alt + Shift + Up/Down (Windows/Linux), Cmd + Shift + Up/Down (Mac)
  • Comment/uncomment line: Ctrl + / (Windows/Linux), Cmd + / (Mac)
  • Comment/uncomment block: Ctrl + Shift + / (Windows/Linux), Cmd + Shift + / (Mac)
  • Surround with: Ctrl + Alt + T (Windows/Linux), Cmd + Alt + T (Mac)
  • Expand/collapse code block: Ctrl + NumPad + / - (Windows/Linux), Cmd + Shift + + / - (Mac)
  • Select next/previous occurrence: Alt + J / Shift + Alt + J (Windows/Linux), Ctrl + G / Shift + Ctrl + G (Mac)

Refactoring Shortcuts

Clean up your code and make it more maintainable with these refactoring shortcuts.

  • Refactor this: Ctrl + Alt + Shift + T (Windows/Linux), Ctrl + T (Mac)
  • Rename: Shift + F6 (Windows/Linux), Shift + F6 (Mac)
  • Change signature: Ctrl + F6 (Windows/Linux), Cmd + F6 (Mac)
  • Extract method: Ctrl + Alt + M (Windows/Linux), Cmd + Alt + M (Mac)
  • Extract variable: Ctrl + Alt + V (Windows/Linux), Cmd + Alt + V (Mac)
  • Inline: Ctrl + Alt + N (Windows/Linux), Cmd + Alt + N (Mac)
  • Optimize imports: Ctrl + Alt + O (Windows/Linux), Cmd + Alt + O (Mac)

Miscellaneous Shortcuts

These are some additional shortcuts to enhance your overall experience in IntelliJ IDEA.

  • Quick documentation: Ctrl + Q (Windows/Linux), Ctrl + J (Mac)
  • Find in path: Ctrl + Shift + F (Windows/Linux), Cmd + Shift + F (Mac)
  • Replace in path: Ctrl + Shift + R (Windows/Linux), Cmd + Shift + R (Mac)
  • Open settings/preferences: Ctrl + Alt + S (Windows/Linux), Cmd + , (Mac)
  • Toggle full-screen mode: Ctrl + Alt + F11 (Windows/Linux), Ctrl + Cmd + F (Mac)
  • Toggle distraction-free mode: Ctrl + Alt + Shift + F11 (Windows/Linux), Cmd + Shift + F12 (Mac)

With these IntelliJ IDEA shortcuts at your fingertips, you'll be navigating, editing, and refactoring code like a pro in no time! Remember, practice makes perfect. So, get started and watch your productivity soar.

Hey there! Want to learn more? Cratecode is an online learning platform that lets you forge your own path. Click here to check out a lesson: Taking User Input (psst, it's free!).

FAQ

What are some essential IntelliJ IDEA shortcuts for code navigation?

Here are a few important shortcuts for navigating through your code in IntelliJ IDEA:

  • Go to the definition of a method or variable: Ctrl + B or Ctrl + Click
  • Navigate between open editor tabs: Ctrl + Tab
  • Jump to the last edit location: Ctrl + Shift + Backspace
  • Go to a specific line number: Ctrl + G
  • Return to the previous cursor position: Ctrl + Alt + Left Arrow

How can I generate code quickly using IntelliJ IDEA shortcuts?

IntelliJ IDEA offers various shortcuts for generating code snippets. Some useful ones include:

  • Generate getters and setters: Alt + Insert and then select "Getter" or "Setter"
  • Generate a constructor: Alt + Insert and then select "Constructor"
  • Override a method: Ctrl + O
  • Implement a method: Ctrl + I

What shortcuts are available for code refactoring in IntelliJ IDEA?

IntelliJ IDEA provides several shortcuts to help refactor code efficiently. Some key shortcuts are:

  • Rename a symbol: Shift + F6
  • Extract a method: Ctrl + Alt + M
  • Extract a variable: Ctrl + Alt + V
  • Extract a constant: Ctrl + Alt + C
  • Inline a variable, method, or constant: Ctrl + Alt + N

How can I use IntelliJ IDEA shortcuts for code completion and editing?

IntelliJ IDEA offers various shortcuts to make code completion and editing a breeze. Some of them are:

  • Basic code completion: Ctrl + Space
  • Smart code completion: Ctrl + Shift + Space
  • Complete a statement: Ctrl + Shift + Enter
  • Duplicate a line or selection: Ctrl + D
  • Comment or uncomment a line or selection: Ctrl + / or Ctrl + Shift + / for block comments

What are some useful IntelliJ IDEA shortcuts for debugging?

Debugging in IntelliJ IDEA becomes more efficient with these shortcuts:

  • Toggle a breakpoint: Ctrl + F8
  • Debug a selected configuration: Shift + F9
  • Step over a method or expression: F8
  • Step into a method or expression: F7
  • Step out of a method or expression: Shift + F8
  • Resume program execution: F9

Similar Articles