Why does NERDTree split or open a new panel seemingly randomly?
Asked Answered
T

1

10

I love vim and NerdTree, but I'm sick of the fact that seemingly every time I try to open a file for viewing, half the time it get's rid of the old file I was editing and just opens it, and the other half splits the panel in half and makes me look at two pages.

Split screen would be useful on occasion, but I can't figure out why NERDTree does it sometimes or not. I'm just going over to the file in the tree and hitting enter. No idea what's going on, but it's a little annoying.

Thistle answered 6/8, 2015 at 9:18 Comment(0)
B
14

If you use the command o and the current window contains a file that hasn't been edited, then the window content will be replaced with the new opened file. Otherwise a new split is opened (in order not to lose the current file modifications).

If you want to better control the NERDTree behavior, follow this cheat sheet:

o: open in prev window
go: preview
t: open in new tab
T: open in new tab silently
i: open split
gi: preview split
s: open vsplit
gs: preview vsplit
Balmacaan answered 6/8, 2015 at 9:25 Comment(3)
Awsome. Thank you very much.Thistle
What is the use of the previews (previes vsplit and preview split)?Chagall
how does one remove a splitMerth

© 2022 - 2024 — McMap. All rights reserved.