VIM: How can I open a file on the right side as vsplit on the left side of the NerdTree panel?

I installed the NerdTree plugin.

How can I open a file on the right side as vsplit on the left side of the NerdTree panel?

+62
vim editor plugins nerdtree
Oct 27 '11 at 5:35
source share
4 answers

There is an s command here, but it opens a file split to the left of the current buffer. Although you can press Ctrl + W r to share windows then.

+64
Oct 27 2018-11-11T00:
source share

To vsplit place a new buffer to the right of the current buffer:

 set splitright 

Similarly, to split place a new buffer below the current buffer:

 set splitbelow 

However, I have not tried this with NerdTree.

+113
Oct 27 '11 at 7:01
source share

This is a little hack, but how do I do it:

  • Place the cursor in the window. I want to open a file in
  • Press <leader>n<leader>n (this closes NERDtree and then opens it again with the cursor in NERDtree)
  • select a file

On my system, this will open in the last window on which I was included, if the file is not already open on my screen. Start in the window where you want to open the file in

Launch the window where you want to open the file.

After <code> <leader> n <leader> n </code> will return to NERDTree

Press <leader>n<leader>n to close and reopen NERDTree

Select the file you want to open!

Choose the file you want!

Fast Cw = will return your windows to the correct proportions.

+2
Sep 26 '16 at 23:18
source share

Not sure if anyone else is struggling with this, but here's how I dealt with it.

you can use

 :ls 

to view available files. That would look something like this:

 1 "foo.txt" 2 "blame_the_user.java" 

:b1 to select foo.txt

:b2 for blame_the_user.java

This method can be executed from any window installation using :sp or :vs

First open the files you want to split.

+1
Jan 17 '17 at 2:32 on
source share