Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to automatically close NERDTree after a file has been opened?

Tags:

vim

nerdtree

The file is opened with the 'return' key on the current tab or with the 't' key to open it on a new VIM tab.

like image 910
Jonathan Maim Avatar asked Aug 30 '11 05:08

Jonathan Maim


People also ask

How do you close open NERDTree?

If you want to close NERDTree window make sure you are inside the NERDTree menu. You can switch windows by using ctrl+w then type :q to close NERDTree window so that you will be left with the window for editing your code.

How do you refresh NERDTree?

Keymap to Refresh NERDTree Once set, pressing Leader + r would refresh NERDTree .

How do I delete files on NERDTree?

Press m to bring up the NERDTree Filesystem Menu. This menu allows you to create, rename, and delete files and directories.


3 Answers

Add the following to your .vimrc

let NERDTreeQuitOnOpen=1 
like image 100
Shootfast Avatar answered Oct 02 '22 08:10

Shootfast


Try :help nerdtreequitonopen.

like image 36
romainl Avatar answered Oct 02 '22 07:10

romainl


Add this line to your .vimrc:

let NERDTreeQuitOnOpen='Value'

and Values :

 Value  | NERDTree Window Behavior
 -------+-------------------------------------------------------
 0      | No change
 1      | Closes after opening a file
 2      | Closes the bookmark table after opening a bookmark
 3(1+2) | Same as both 1 and 2
like image 23
mo1ein Avatar answered Oct 02 '22 09:10

mo1ein