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.
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.
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.
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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With