DEV Community

Cover image for The best 10 Shortcuts of IntelliJ I would often use
owl✨
owl✨

Posted on • Edited on

The best 10 Shortcuts of IntelliJ I would often use

Introduction

IntelliJ provides us with many shortcut keys. It makes the development cycle speed up.
While it is convenient to use countless keys, more keys cause more confusion. I, therefore, picked up the essential keys on development and recorded them in this document.
If you had any excellent keys that you strongly recommend, leave comments about them. I would update this document with your comment taking the screen capture. Thank you.

Shortcut keys

The following shortcut keys are for Mac only.
Using Windows, you can replace the command key in Mac with the control key in Windows. I'm guessing it might work.
  

1. Expand editor

⌘ 1 is used to expand the editor area while simultaneously closing the left-side window.

Image description
  

2. Switch editor tabs

This shortcuts, ⌘ shift [ and ], allow you to quickly switch between editor tabs, making it easy to focus on the specific tab you need, such as the Browser tab.

Image description
  

3. Jump at the navigator file name

⌥ F1, followed by 1, allows you to quickly move the focus to the file name in the tool window. This is particularly useful when you want to navigate to the file name in the navigator area for the currently open file in the editor.

⌥ F1, then 1

Image description
  

4. Show the list of recently opened files

⌘ e opens a list of recently opened files, making it easy to quickly navigate to files you've worked on recently.

Image description
  

5. Fix syntax error

⌥ Enter is used to quickly fix syntax errors, such as undeclared variables or missing imports, by showing you available code suggestions and fixes.

Image description
  

6. Move line

⌥ shift ↑/↓ is used to move the currently selected line or block of code up or down in your code editor, allowing you to quickly adjust the positioning of code within your file.

Image description
  

7. Toggle Case

⌘ shift u toggles the case of selected text, converting uppercase letters to lowercase and vice versa.

Image description
  

8. Reformat code

⌘ ⌥ L is used to automatically format your code, including fixing broken indents, ensuring that your code adheres to a consistent and readable style.

Image description
  

9. Show Hierarchy

⌥ ctrl H opens the Hierarchy tab, which lists the caller methods, allowing you to navigate and explore the hierarchy of method calls in your code.

Image description
  

10. Rename

Shift F6 allows you to rename a method without needing to consider refactoring for its caller methods.

Image description

Conclusion

The above keys are the ones I rely on daily while coding, but there are many other valuable shortcuts out there. As mentioned earlier, if you have any excellent shortcuts you'd like to recommend, please let me know, and I'll be happy to update this article. Thank you!

Top comments (0)