How to switch between tabline and buffers view in vim airline? - vim

I've been using vim-airline on vim-8.0 and it displays tabs in the tabline and when I mouse left-click (with mouse input enabled) on filename on the far right hand side of the tabline the view switches to buffers (if I have enabled the option: let g:airline#extensions#tabline#show_buffers = 1).
But so far I can't seem to find a way to get back to tab view again? This may just be a standard vim tab navigation issue as even with show_buffers disabled when I click on the right hand side of the tabline I get stuck with viewing just that file.
A solution using the mouse would be preferable but a vim command would be fine too.

Related

VIM: omnicomplete popup menu has incomplete message

I'm using YouCompleteMe library into vim to autocomplete my code.
I have an issue for vim popup menu as shown in the image below the addEventListener method in javascript has long description here but it get cut because of my screen bound. is there any way to scroll horizontally to read the missing part like I do when I'm scrolling vertically <c-n> for down and <c-p> for up. Is there is any short key for moving right and left on vim popup menu or any other way to achieve that.
No, there's no way to achieve that in Vim's current state.
Vim already has a perfectly working way to display extensive documentation in the preview window during completion so your plugin is misusing the completion menu.
You should either tell its author to use the completion menu properly or find a better one.
From :help 'completeopt':
preview Show extra information about the currently selected
completion in the preview window. Only works in
combination with "menu" or "menuone".

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

GVim tab bar: scroll tab bar instead of changing buffer on arrow click?

I frequently have 10-20 files open simultaneously in GVim (more than fits nicely into screen horizontally) and I've enabled tab bar (set showtabline=1). I'd like to change the tab bar behaviour so that when I click the arrow button on either end of the tab bar, the tab bar would scroll instead of switching to next/previous tab. Is this possible?
No, I don't think this is possible. All aspects of tab pages are described at :help tabpage, and I didn't find a setting there.
In general, you should avoid having too many tab pages, because you lose out on opportunities for quick navigation and movement of text across buffers. Things like the quickfix and preview windows always open in window splits, so learn how to use them (and the underlying concepts of windows vs. buffers).
I know that many people today open dozens of tabs in their browsers, but Vim is different. I only use tab pages to separate different workspaces (e.g. edit a mapping in tab 3 while I'm coding in tab 1 and have the documentation in tab 2).

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.

Is it possible to have 2 Nerd Trees in same view in 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.

Resources