Is it possible to have 2 Nerd Trees in same view in vim - vim

I am using vim 7.3 and the NERDTree 4.1 plugin.
I have been trying to get 2 NERDTrees to appear in the same tab but can't find how to do it so I am on the verge of calling it a day.
Just wondered if anyone new if it was possible and if so how?

Hmm, I don't think that's possible, at least I don't know any solution. NERDTree window is positioned in a screen-wise way, even if you open another window and toggle the Tree it will affect the single one.
I have been searching the help, but the closest topic I found is about window positioning. It says nothing about multiple windows, but suggests that one exclusive NERDTree window will be present on screen:
------------------------------------------------------------------------------
'NERDTreeWinPos'
Values: "left" or "right"
Default: "left".
This option is used to determine where NERD tree window is placed on the
screen.
This option makes it possible to use two different explorer plugins
simultaneously. For example, you could have the taglist plugin on the left of
the window and the NERD tree on the right.
------------------------------------------------------------------------------

I get close to the desired outcome by pressing 's' over a directory node, this opens a new vertical window with NERDTree characteristics but without the positioning.
Therefore I then might need to to resize so the file open for edit has greater presidence:
vert resize 30
and possibly set height and width of the new NERDTree window so it doesn't keep moving with new files:
set wfw
set wfh
And then every time I try open a node out of the new window (with 's') it shifts to the right so I need to move it back with.
CTRL-W_H
Not very convenient I must admit.
In that case the answer to the questions is no, in NERD Tree's current state

Just Open NerdTree and go to command mode and write :sp or :vsp. Now the nerd tree will splited in 2 panes.
This has some problems in navigation and resize wont work as expected. Else it works good.

Related

vim x/y scrollbar hiding my commands and being really anoying

i'm a new vim user since 2 weeks and i've currently have my biggest trouble for the moment on vim.
i always have a x and y scrollbar on my vim and the x one is very anoying because it cover my commands.
here is a screenshot of the scrollbars that appears when i use terminal inside of vim using `:term` / `:!dir` or even when i save my vimrc or source it (`:so ~/.vimrc`)
if there is any solutions to it i will be really grateful, thanks for reading
This is an issue with your layout settings in Powershell and Ubuntu. Right click on the top bar of either program, go to Properties and then go to the Layout tab. You can check the Wrap text output on resize box and that should get rid of your horizontal scrollbar, thereby allowing you to use Vim as normal. Alternatively, in the same menu, you can decrease the width of the screen buffer size so that it is smaller than the width of the window size.

Hot to prevent recalculating window sizes in vim?

I show what happens step-by-step to explain the case:
This is my layout:
After I run :vs new to create new file in the separate window:
Now you can see that the leftmost window with directory tree is unexpectedly expanded by several columns. And and I close the new buffer by ^Wc or :close the rightmost window expanding again!
What's going on? Is there any ways to "fix"/"stick" window sizes. Windows like water - they are constantly resizing(
Option equalalways when set, makes Vim equalize the windows sizes when a window is closed or opened. You can switch it off by using
set noea
or you can change its behaviour by adding the eadirection option to control in which direction windows should be equalized.

Disable window resize when changing focus

I have a single vim-tab with multible windows. When i change the focus to another (vim-)window, vim seems to impose a minimal window width. For example, if i have 2 open windows split vertically, a change of focus to the right one results in shifting the seperators a bit to the left (1 character, i guess the terminal-width is odd) , and vice versa. This is annoying especially when there are more windows, since moving around changes the layout of the tab.
i tried setting wfw, but now when i open another window (again split vertically) the new one will have width 1, and Ctrl-W = doesn't work any more.
Is there an option to disable resizing on focus change, while still beeing able to Ctrl-W =?
Edit: I'm running vim 7.4, beeing the official debian jessie vim-gnome package. The behaviour is reproducable even without .vimrc. I'm using urxvt, and xterm shows the same behaviour.
I don't know what exactly went wrong, but the problem was caused by using the session file i created with vim-obsession.
Deleting this file and starting a new session fixed the above.

NerdTree re-positions Vim Window

I am using gvim on Windows 7. I just installed NerdTree and observed something abnormal.
Usually I have two application open side-by-side by dragging them the left and right border of screen, and then Windows will automatically adjust the width and positions for them.
So, I have vim and another application open side by side today, and needed to navigate the file system. So I did NERDTreeToggle and all the sudden, my nicely positioned vim jumped to a different position (The default one when starting vim).
I am wondering if there is anyway to prevent this from happening.
Thanks.
This is probably caused because due to the vertical split (of the NERDTree sidebar), Vim displayed a second scrollbar (on the left), and that causes the Vim window to increase its width, and that made it "break out" of your layout.
You can avoid that second scrollbar via
:set guioptions-=L

vim (gvim) - dock the tab bar on the right instead fo the top

Is it possible to set the dock position of the tab bar? I can only see a few tabs in it's default position on top, it would serve me much better on the right.
Is it possible to do this? Or is there a plugin for keeping the buffers displayed similar to tabs (but docked on the right instead of the top)? NERDtree is really cool but it doesn't list the open buffer
It isn't possible to put the tab bar on the right. Or anywhere else for that matter, apart from where it is now.
As far as buffers list, there are several plugins for managing buffers, MiniBufExplorer being one of the more popular ones. NERDTree is not really a buffer manager, more of a file manager.

Resources