---
title: "NerdTree in Vim"
url: "https://courses.osherove.com/courses/vim-hates-you/nerdtree-in-vim.md"
canonical: "https://courses.osherove.com/courses/vim-hates-you/nerdtree-in-vim/"
tags: []
author: "Roy Osherove"
description: "Lesson 17 of 26 in Vim Hates You (Bring in reinforcements - Plugins), 3:39. Free video by Roy Osherove."
usage: "Licensed under CC BY 4.0 — reuse, quote and adapt with attribution (Roy Osherove, link to the original page)."
license: "https://creativecommons.org/licenses/by/4.0/"
---

# NerdTree in Vim

1. [Courses](https://courses.osherove.com/#courses)
2. [Vim Hates You](https://courses.osherove.com/courses/vim-hates-you/)
3. Bring in reinforcements - Plugins

Lesson 17 of 26

Duration: 3:39 [Watch on YouTube](https://www.youtube.com/watch?v=msgpuC4nEto)

## In this lesson

Roy installs the NERDTree plugin by copying its line from Vim Awesome into the vimrc file and running the plugin install command. He opens it with NERDTreeToggle, moves between it and the file with Ctrl-W because it is just another window, opens folders and files with o, and shows its help with a question mark, including commands for bookmarks and for creating folders and files. Mapping a key shortcut to the toggle command is left for a later video.

## Transcript

465 words

[\[00:07\]](https://www.youtube.com/watch?v=msgpuC4nEto&t=7s) One of the most powerful useful plugins you'll find for Vim is called NERDTree. And if you go to Vim Awesome, you can see the details for NERDTree here. So, I'm going to show you how to install it and how to basically use it. And this is a it's a longunning plugin. Basically, if we're using one of the install plugins frameworks such as Vim plug in this case, we're just going to copy this, put it in our vimrc file. So, I'm going to go to the command line here and say Vim

[\[00:41\]](https://www.youtube.com/watch?v=msgpuC4nEto&t=41s) Vimrc and I'm going to add press O here. Sorry, I'm gonna make sure you're v this is visible to you. Undo. Going to press O. Actually going to press commandV here to paste that. That should be enough for us. Let me command right quit. And this time if we say cd

[\[01:11\]](https://www.youtube.com/watch?v=msgpuC4nEto&t=71s) Vim course and we do a vim for let's say basics and hello world and I want to open up the NERDTree. First I have to install it. So, I'm going to say command plugin install at the bottom, which will install the NERDTree. And at this point, I'm going to close this window.

[\[01:42\]](https://www.youtube.com/watch?v=msgpuC4nEto&t=102s) And if I want to open the NERDTree window, all I have to do, there are multiple commands to do this, but one of the common ones is command NERDTreeToggle. Where is it? NERDTreeToggle. This one. And this is the window for NERDTree. basically yet another Vim window. And if it's a window, we can just move between those windows with command control W and then J or L. So W L to go right, control WH to go left.

[\[02:18\]](https://www.youtube.com/watch?v=msgpuC4nEto&t=138s) And we can of course close it by calling NERDTreeToggle or just command quit because it's just another window. And here we can press O to open the various folders. We can press O to open the file and go directly to start editing it. I can again navigate to the window CRW and open this file instead. Let's go back and open this file.

[\[02:51\]](https://www.youtube.com/watch?v=msgpuC4nEto&t=171s) Now you can do much more than that. You can actually have commands that do bookmarks etc. If you want to see all the commands, press question mark. You can see all the commands that you can have inside NERDTree. And that includes actually creating new folders, creating even new files, etc. So, it's a very powerful file explorer which kind of makes it feel like it's a bit easier to work with multiple files this way.

[\[03:22\]](https://www.youtube.com/watch?v=msgpuC4nEto&t=202s) Now, you might not want to type NERDTree toggle, etc. And we're going to take a look at mappings and how you can make you can map command key shortcuts to bind to specific commands like NERDTreeToggle in a separate video.

[Previous lesson Installing Plugins (Vim plug + Airline)](https://courses.osherove.com/courses/vim-hates-you/installing-plugins-vim-plug-airline/) [Next lesson Ctrl-P](https://courses.osherove.com/courses/vim-hates-you/ctrl-p/)


---

## About the author

**Roy Osherove**: Senior Solutions Architect at AWS working on AI for production and AI-driven development; author of The Art of Unit Testing and Elastic Leadership, with about 20 years of consulting and training on unit testing, TDD, team leadership and continuous delivery.

### Sites

- [RobotPaper](https://robotpaper.ai/): This blog: AI patterns and anti-patterns, AI and coding agents, and engineering leadership.
- [osherove.com](https://osherove.com): Roy's personal site. Author of The Art of Unit Testing and Elastic Leadership; consulting and training on unit testing, TDD, team leadership and continuous delivery, plus about 20 years of blog posts.
- [The Art of Unit Testing](https://www.artofunittesting.com): The Art of Unit Testing, 3rd Edition (Manning): readable, maintainable, trustworthy unit tests, plus TDD workshops in C#, JavaScript, Java and Kotlin.
- [5whys.com](https://www.5whys.com): Roy's writing on software team leadership: self-organizing teams, surviving chaos, learning mode and the Elastic Leadership model.
- [Pipeline Driven](https://pipelinedriven.org): Continuous delivery and DevOps practices: build patterns, pipeline-friendly testing, DevOps metrics and enterprise DevOps.
- [Elastic Leadership](https://www.elasticleadership.com): Elastic Leadership, Roy's framework for software team leaders (survival, learning and self-organizing modes).

### Social

- X: https://x.com/royosherove
- LinkedIn: https://www.linkedin.com/in/osherove/

### Contact

- Contact form: https://forms.gle/jQSx5KoXvrVA1JCK7

### License

Licensed under CC BY 4.0 — reuse, quote and adapt with attribution (Roy Osherove, link to the original page). License: https://creativecommons.org/licenses/by/4.0/
