Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Move adjacent tab to split?

Tags:

vim

Is there an easy way to move an adjacent tab in Vim to current window as a split?

While looking around I reached a mailing list discussion where someone said it's the reverse of the operation Ctrl+W,T without providing the solution.

like image 581
mhitza Avatar asked Feb 04 '13 14:02

mhitza


People also ask

How to split tab in vim?

Simply use vim *. py when opening files (without the -p option that opens them in tabs), and navigate them using :n and :prev (or :N ). You can then split with :vs or :sp and use the Ctrl-W commands to switch and reorganize windows.

How do I switch between splits in Vim?

To switch to the right window, press “Ctrl + w”, then “l”. To go to the left window, it's “Ctrl + w”, then “h”. If you did a horizontal split, then going up and down is necessary. For going up, press “Ctrl + w”, then “k”.

How do I use tabs in Vim?

To directly move to first tab or last tab, you can enter the following in command mode: :tabfirst or :tablast for first or last tab respectively. To move back and forth : :tabn for next tab and :tabp for previous tab. You can list all the open tabs using : :tabs. To open multiple files in tabs: $ vim -p source.


1 Answers

The problem with your problem is that a tab is not tied to a specific buffer. You can have 10 windows with as many buffers in a tab so "moving a tab into a split" doesn't make much sense.

What makes more sense is "show buffer x into a split" which can be done with

:sb <name_of_buffer> 
like image 125
romainl Avatar answered Sep 20 '22 13:09

romainl