Last Updated: February 25, 2016
·
704
· Rafael Bicalho

Easy tab navigation in MacVim and GVim

Add the following code to your vimrc file, to select tabs using the command+number or control+number keys (Like in Firefox or Chrome).

For MacVim users:

" Alternative tab navigation (cmd+number)
map <D-1> 1gt  
map <D-2> 2gt  
map <D-3> 3gt
map <D-4> 4gt
map <D-5> 5gt
map <D-6> 6gt
map <D-7> 7gt
map <D-8> 8gt
map <D-9> 9gt

For GVim users:

" Alternative tab navigation (cmd+number)
map <C-1> 1gt  
map <C-2> 2gt  
map <C-3> 3gt
map <C-4> 4gt
map <C-5> 5gt
map <C-6> 6gt
map <C-7> 7gt
map <C-8> 8gt
map <C-9> 9gt