Create a new File from the Navigation Bar

A fast way to add a new file to your project, without touching the mouse.

The Problem

How can I create a file if I've turned off the Project tool window? Let the Navigation Bar be your one-stop replacement for the Project Tool window!

The Solution

In your JetBrains IDE, invoke the "Navigation Bar" with ⌘↑ (macOS) / Alt+Home (Windows/Linux)

You can now:

  • Use the cursor keys to get to the target directory
  • Speed search to select any subdirectories

arrow-keys.png

Once you have selected your target, use ⌘N (macOS) / Alt+Insert (Windows/Linux) to bring up the new file dialog. Just like in the Project tool window, the new file is opened after creation.

Also like the Project tool window, your selection doesn't have to be on a directory. If you're on a file, the new file will be created as a sibling. This is particularly useful in the common case of creating a new file in the current directory:

  • Activating the navigation bar highlights the current file.
  • Immediately press New ⌘N (macOS) / Alt+Insert (Windows/Linux)

In summary, after two key combos, you have a new sibling file, with no permanent file tree visible and no popups to close afterward. That's what getting in the flow is about.

new-file.png

If you want to know what else the Navigation Bar can do, check out Navigating Like a Pro.


Related Resources

Navigation Bar - All the power!
Navigation Bar - All the power!
The Navigation Bar can do much more than you think!
Find in Path with the Navigation Bar
Find in Path with the Navigation Bar
Use the Navigation bar and Find in File together and be faster than all of your team members.
Speed search with the Navigation Bar
Speed search with the Navigation Bar
Use the keyboard abbreviations to quickly find what you're looking for in the Navigation bar.