Life Without the Project Explorer

It’s an indisputable (alternative) fact that, since Before the Dawn of Time™, or at least since GUIs became in vogue, file explorers are an essential part of any programming tool. Gotta browse them trees. It’s impossible to imagine not having your directory browser open in something like PyCharm’s Project Tool.

Or is it? I recently took my boss Hadi’s challenge. Well, I took part of it. I closed my Project Tool window and used other ways to navigate my files. And I liked it. Here are ways to enjoy Life Without the Project Explorer.

Meet You at the Bar…Navigation, That Is

PyCharm’s Project Tool is visible by default. Let’s go cold turkey and close it by clicking its hide button .

If you don’t have the Navigation Bar visible, turn it on by selecting View -> Navigation Bar. You’ll see it appear on the first row inside your window. If you are in a deep hierarchy, you’ll see breadcrumb-like buttons, starting at the project root, all the way down to the currently-visible file:

Basic navigation bar

Basic navigation bar

Ok, let’s do some fun things. You want to open the file in the examples parent. You simply click on examples in the Navigation Bar and select the file:

Opening a file via navigation bar

Opening a file via navigation bar

Hmm, we have a problem. The Navigation Bar is space-constrained, so it can’t show everything in the examples folder. You want to open the file That’s a problem. But hey, we’re PyCharm, we make solutions…in this case, speed search to the rescue. You just click on the target and start typing some letters of the filename, then the list is filtered:

Speed search in navigation popup

Speed search in navigation popup

Like all places where PyCharm filters lists, you can use CamelHump syntax for the search expression.

Opening files isn’t the only thing we use the Project Tool for. What about creating a file in a subdirectory? Yep, you can right-click, not only on a folder directly in the navigation bar, but also inside a folder in the popup:

Creating a file via navigation bar

Creating a file via navigation bar

The other context-menu operations are also possible. Here’s one I use constantly, Find in Path:

Find in Path in navigation bar and popup

Find in Path in navigation bar and popup

Hmm, here’s a tough one though. What if you want to browse and then open a file not in one of my parent folders. Ok, I lied, it’s easy:

Navigation alternate directory path

Navigation alternate directory path

That covers almost everything that I would have used the Project Tool for. What might you miss by using the Navigation Bar? You can’t re-organize via drag-and-drop. You can’t do anything that requires multiple selection. And while it show icons for types of files and even color-coding for VCS status, it doesn’t show coverage information.

Anything else I left off the list? Leave a comment and I’ll update this blog post.

The Navigation Bar is a nice first step away from the Project Tool window. If you want to go further and hide the Navigation Bar, what are some choices?

What Was I Just Doing?

Most of the time, I switch between a handful of files that I’m actively working on. The other hundred (or, in an npm-based project, trillion) files are in the “not urgent” pile. PyCharm has features that makes this workflow very convenient.

I’ll start with the one I use the most — Recent Files aka Ctrl-E:

Opening a recent file

Opening a recent file

Let’s say you’re editing some function, and you’re writing the test for that function. You’re switching back and forth. It’s very easy and non-disrupting: Ctrl-E then Enter — because the most-recent file is listed first and selected.

What if the file you want isn’t the first entry in the Recent Files popup? You could take your hands off the keyboard, grab your mouse, but you’ll hear the distant sounds of Hadi yelling “Go mouseless!” You could use the keyboard’s down arrow. Or…yep, as in all things, speed search to the rescue:

Speed search in recent items

Speed search in recent items

Recent Files also lets you navigate by mouse/arrow/speed search to tool windows. Want to get quickly to the terminal without using your mouse?

Speed search to terminal

Speed search to terminal

But maybe you just want the files you’ve recently edited, not visited. Recently Changed Files Shift-Ctrl-E might be the action/shortcut you use the most:

Recently edited files

Recently edited files

There’s one more…the leanest-meanest popup around: the Switcher at Ctrl-Tab. Or more specifically, Ctrl-Tab and keep holding Ctrl. The Switcher disappears when you let go of Ctrl. While it’s visible, move around with the arrow keys, or Tab/Shift-Tab to move forward/backwards in the listing and columns.

If you’re like me, these 3 choices are two too many. I currently make Ctrl-E and speed search my primary, don’t-make-me-think option.

This Tab’s On Me

It’s now confession time. I still use tabs. My last hurdle is, of all things, TDD. In Python and Angular 2, I try to write tests as I write my code, and it’s nice to see both. Though I think there’s one more level of TDD zen I can reach to eliminate even this need.

This article is by no means a harangue to tell you how to use your tool. I think tabs are ok. In fact, “highly visible tabs” was one of two things that finally made me switch from Emacs to PyCharm years ago.

At the same time, as you become more of a badass, and especially if you’re coming from a lean-and-mean editor background, you might find it appealing to turn off the Project Tool and use lighter-weight choices for navigation. A hybrid, as described in this article might be the shoe that fits your foot.

This entry was posted in Cool Feature, Tutorial and tagged . Bookmark the permalink.

19 Responses to Life Without the Project Explorer

  1. Michal says:

    I prefer Crtl/Shift/Alt-N

  2. Adelle says:

    Love this tutorial! Thanks a lot!

  3. Dan Gamble says:

    Life without anything:

    I took this journey myself and now constantly find myself in “Distraction Free Mode”. Really do love how much PyCharm allows you to do everything with your keyboard.

    • Paul Everitt says:

      I’m thinking about expanding on this into a full “life without tabs” type of series. Dan, do you have a few techniques that you rely on, that you think should go in it?

      • Dan Gamble says:


        Main menu
        => Navigate
        => Class
        => File
        => Symbol

        Being able to search for class names by camel case (s-HA returns shr-Hero_Activator) is huge. When i think “Hmm i wanna edit x class” i’m thinking of exactly that. I don’t want to think what file x is in so being able to jump to exactly what i am thinking to without a mouse is just such a huge bonus. The same goes for function methods, even on classes (Pers.get_ will take me to Person.get_absolute_url())

        Obviously there are times where i know roughly what i want but not exactly so that’s where the file name search comes in.

        Obviously we also have the usual find and replace which i mainly use to find how many aspects of a certain thing appears as opposed to going to something.

        Navigate => Jump to Navigation Bar is something that helps when hiding the Project Explorer like you have but still wanting to be able to navigate the the structure of the project and create new files.

        alt+enter is a great way to do imports and refactoring.

        refactor => refactor this is a great way to get a single keybind on all the refactors that are available.

        These are just a few i use everyday to help keep me away from the mouse and menus :)

        • Paul Everitt says:

          You’re right that, in my next installment, I should lead with jumping directly to the class/symbol you are looking for. You phrased it well: stop thinking about files. Thanks for the other tips on keyboard-centric coding…like you, I’m doing alt-enter all the time (and letting imports get generated, for example.)

    • Steve says:

      Nice! What font are you using here in your editor?

    • Gauthier P. says:

      You use presentation mode to write code, right ?

      Something I currently miss is the possibility to center code as in presentation mode but without presentation mode enabled.
      I use presentation mode for … presentations, but when I write code, I prefer a smaller font size and having to change it every time I do a presentation is a bit boring…

      I think there is an issue about providing a setting to center code outside of presentation mode, but I can’t find it… I hope JetBrains guys will be able to add it ! It would perfectly work with a “no project explorer” approach ! (And I like the “life without anything” too 😛 ).

      The issue :

      • Paul Everitt says:

        I actually don’t use Presentation Mode. I turn off some things manually, turn them back on. I confess to being “fiddly”…I never quite settle on one particular layout.

        Your comment looks like you were trying to paste a link but it got chopped off.

        • Gauthier P. says:

          Ah yeah, I forget to remove the last line as I didn’t find the issue asking to add an option to center code outside of presentation mode.

          Anyway, it’s a feature I’m really looking for ! :)

  4. Johann Visagie says:

    You can go even further if you’re a keyboard warrior:

    There’s no need to display the navigation bar permanently (and waste a line of screen real estate) — it pops up on demand when you press Cmd+UpArrow (Mac OS X 10.5+ keymap).

    This is great for navigation, but if you want to create a new file (for instance) you still need to reach for the mouse and click the right button. Or do you…?

    It turns out you don’t! You can map “Show Context Menu” to a keyboard shortcut (I have it on Ctrl+,) and suddenly you have the full functionality of the navigation bar available without having to reach for the mouse: Cmd+UpArrow to make it appear contextually, then move around in it using the arrow keys, Ctrl+comma if you need to open the contextual menu at any point, and then navigate the menu using the arrow keys again.

    • Paul Everitt says:

      I agree with your points, but I wanted to make this article a first, intermediate step towards keyboard-centric. Your point about hiding it and making it appear on demand, though, would make a good tip tweet. I’ll put that on the schedule.

      The “Show Context Menu” shortcut is a clever idea! I’ll try putting that into my workflow.

      • Johann Visagie says:

        Paul, I wasn’t meaning to criticise! I quite understand how you pitched the article; I just meant to add some additional flavour.

        As someone who has spent decades developing in vi (and later Vim), I have a vested interest in a clean, uncluttered and keyboard-centric environment. So I’m cheering you on from the sidelines, very keen to see where you’re going with this next!

        Something I neglected to say in my comment yesterday: If you know the shortcut for a specific action, you often don’t need to invoke the contextual menu from the navigation bar. For instance, if you want to create a new file, you can just bring up the nav bar, navigate to where you want the new file to be, and then hit Cmd-N.

        One final comment… I got many of my original ideas for streamlining my PyCharm use from this (by now quite outdated) blog post:

  5. Holger Brandl says:

    Why isn’t there a file context menu for the file items when using the navigation bar? Having a context menu would make the bar a more complete replacement for the project-tool-window. Is there a youtrack ticket for such a feature?

Leave a Reply

Your email address will not be published. Required fields are marked *