As other answers have mentioned, gt
(g
for the "go to" command, and t
for tab).
Which can be prefixed by the tab number, as in 1gt
to go to tab one. (which IMHO is weird, as that syntax should mean "move N tabs from the current one", as happens with all other movement prefixes, e.g. 2w
)
join that knowledge with the fact that most terminals give you either <D-n>
or some weird symbol when you press Alt+1
and you can use:
(NOTE! you must check what you get by actually typing ALT+1
on your terminal)
"tabs like firefox
"must use the especial chars (created in ABNT2 keyboard, tested on US keyboard. Under both X and wayland)
"when you press alt-1...0
noremap ± 1gt
noremap ² 2gt
noremap ³ 3gt
noremap ´ 4gt
noremap µ 5gt
noremap ¶ 6gt
noremap · 7gt
noremap ¸ 8gt
noremap ¹ 9gt
noremap ° 10gt
"and now the same for right_alt-1..0
noremap ¹ 1gt
noremap ² 2gt
noremap ³ 3gt
noremap £ 4gt
noremap ¢ 5gt
noremap ¬ 6gt
noremap { 7gt
noremap [ 8gt
noremap ] 9gt
noremap } 10gt
"and for mac command+1,2,3... support:
noremap <D-1> 1gt
noremap <D-2> 2gt
noremap <D-3> 3gt
noremap <D-4> 4gt
noremap <D-5> 5gt
noremap <D-6> 6gt
noremap <D-7> 7gt
noremap <D-8> 8gt
noremap <D-9> 9gt
noremap <D-0> 10gt
Now, "typing" those symbols in command mode will move you to tabs. The result is that you can move tabs like any other GUI application! ALT+1 move to tab one, ALT+2 for tab two, etc.
And you can still type those chars if you need to because we are only remapping in command mode.
:tabn
,:tabp
Map them asmap <C-PageUp> :tabnext
– Nonpayment