How can I change the position / order of my current tab in Vim
? For example, if I want to reposition my current tab to be the first tab?
Here's my macro, using relative arguments from @maybeshewill's answer:
" Shortcuts to move between tabs with Ctrl+Shift+Left/Right
function TabLeft()
if tabpagenr() == 1
execute "tabm"
else
execute "tabm -1"
endif
endfunction
function TabRight()
if tabpagenr() == tabpagenr('$')
execute "tabm" 0
else
execute "tabm +1"
endif
endfunction
map :execute TabRight()
map :execute TabLeft()
It handles the wrapping case.