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

4

39

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.

Shah answered 30/8, 2011 at 5:53 Comment(0)
B
19

Try :help nerdtreequitonopen.

Bazemore answered 30/8, 2011 at 6:21 Comment(0)
L
86

Add the following to your .vimrc

let NERDTreeQuitOnOpen=1
Lemuel answered 7/2, 2013 at 21:21 Comment(0)
B
19

Try :help nerdtreequitonopen.

Bazemore answered 30/8, 2011 at 6:21 Comment(0)
E
1

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
Effluvium answered 18/2, 2021 at 0:34 Comment(0)
A
0

Try something like let NERDTreeCustomOpenArgs = {'file':{'keepopen': 0}}

Archive answered 17/2, 2021 at 17:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.