NERDTree an anti-pattern?

kwstannard

Kelly Stannard

Posted on January 6, 2020

NERDTree an anti-pattern?

Hi everyone, I wanted to talk about NERDTree because I have seen it recommended in basically every Vim guide but I think if you want to be serious about improving productivity with Vim then using NERDTree is a mistake. I have paired with people who use it and when the directory tree pops up I know I need to sit back and relax for a few minutes and maybe catch up on my meditation.

These are the use cases for NERDTree as explained in the readme. I will cover them and suggest a faster, preexisting alternative.

Visual browsing

This can be useful when you are first getting to know a project. But, the need for this would drop to zero pretty quickly as you become familiar. Some possible alternative ways to visually browse a directory:

  • ls on the command line
  • Vim's default directory browser that is available by opening a buffer on a directory.
  • find <path> | less is available everywhere and the output can be learned fairly easily.
  • tree can be installed and outputs a traditional directory tree.

Opening files

This I think is where workflows involving directory trees start taking a turn for the worse as you can get in the habit of using NERDTree all the time. Anyone serious about file editing should learn how to fly to a file with little more than a thought.

edit: I switched from splats to :find thanks to James's suggestion and also gf. gf works very well in a conventional Rails app. Both are orders of magnitude faster than NerdTree.

Other operations

I don't think I have ever seen other operations used, so I can't really comment. I think most people use other tools already. 🤷‍♂️

Thanks for your time. Let me know if there is some killer feature in NERDTree I missed or other alternatives in the comments.

💖 💪 🙅 🚩
kwstannard
Kelly Stannard

Posted on January 6, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related