Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rearrange tabs with the mouse in gvim

Tags:

Is there any way in gVim to rearrange tabs by dragging and dropping them with the mouse? The behavior I'm looking for is that similar to tabs in Firefox and Chrome.

I know that it's possible to change tab order using :tabm n but that requires figuring out exactly how many tabs in you'd like to move to. Using the mouse would be more useful for this spatial task.

Any methods to move tabs left/right by one position would also be useful, since one could remap keys and move tabs without thinking too hard.

like image 853
werkshy Avatar asked Jan 21 '10 00:01

werkshy


People also ask

How do I move tabs in Gvim?

If you're really meticulous and want to position tabs just so in Vim, you can move the tabs to a specific spot in the tab order using :tabm n , where n is the position number that you want to use. If you don't give the :tabm command an argument, then the current tab will be moved to the last spot.

How do I rearrange tabs in Vim?

You can use :tabmove followed by the tab number to move past. For example, :tabmove 3 will make the current tab move past the 3rd. :tabmove 0 moves to the beginning and :tabmove (without a number) moves to the end.


1 Answers

Here's what's in my vimrc regarding tabs:

" Move tabs with alt + left|right nnoremap <silent> <A-Left> :execute 'silent! tabmove ' . (tabpagenr()-2)<CR> nnoremap <silent> <A-Right> :execute 'silent! tabmove ' . tabpagenr()<CR> 
like image 145
chris.ritsen Avatar answered Oct 20 '22 11:10

chris.ritsen