You can use the tabmove
command. (:help tabmove
will tell you all you need to know)
The command takes two kind of parameters:
A sign (+
or -
) followed by a number:
:tabmove +2
will move your tab of 2 places to the right
:tabmove -2
will do the same to the left.
You can also use the command with a simple number to set the position of the tab:
:tabmove 0
will put the tab as the first one
:tabmove 2
will put the tab in the third position
:tabmove
will put the tab as the last one
Also I put those lines in my .vimrc
" move current tab to left/right
noremap <Leader><Left> :execute 'silent! tabmove ' . (tabpagenr()-2)<CR>
noremap <Leader><Right> :execute 'silent! tabmove ' . tabpagenr()<CR>
They allow you to move the current tab of one place with the combination Leader+Right arrow and Leader+Left arrow maybe they could be useful to you.
Edit: As @TomMcDo pointed out in the comments the previous mappings could be simplified and still work properly:
noremap <Leader><Left> :tabmove -1<CR>
noremap <Leader><Right> :tabmove +1<CR>