Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VsVim keyboard shortcut to switch between files/tabs?

I recently installed VsVim.

It's great, but I find myself constantly reaching for the mouse in order to switch between files.

Is there a built in solution? I cannot find a list of VsVim shortcuts anywhere.

like image 579
Runcible Avatar asked Sep 10 '14 17:09

Runcible


4 Answers

Found the answer here: Tab/Window group movement: (Ctrl-W)(Ctrl-L), etc

Use gt or gT to go back and forth between tabs.

like image 109
Runcible Avatar answered Oct 13 '22 04:10

Runcible


Also note that Ctrl+Tab works for cycling through tabs.

It seems to be implemented as a MRU-to-LRU tab stack, meaning that hitting Ctrl+Tab once will take you to the most recently used prior tab, and hitting Ctrl+Tab again will take you right back where you were.

There's a pop-up that displays the available tabs as long as Ctrl is held down, allowing you to choose a tab from the list.

Basically this is similar to classic MDI window tabbing.

I don't think this is part of VsVim, but rather a pass-through to Visual Studio.

like image 44
Garry H Avatar answered Oct 13 '22 05:10

Garry H


Also as an addition to these ways of swapping windows I also use

ALT W then you can use the number keys to select a tab. this is kept in most recently used order, so selecting 2 will always go to the previous tab you were in.

The other thing you can use is marks. m<capital letter> will set a mark that jumps across files ( lowercase marks work within a file ). To jump to a mark use `< mark letter >

like image 45
Keith Nicholas Avatar answered Oct 13 '22 04:10

Keith Nicholas


First if you are talking about tabs gt and gT work for Going to next/prev Tab.

This question is pretty old, so the <C-w> shortcuts might not have been implemented yet, but even in Vim I never did like those shortcuts. As I substitute I added some leader bindings using the standard hjkl navigation keys. My leader is mapped to spacebar, so these are really easy to use. I also rebind tab navigation to [b and ]b, which are buffer navigation bindings in one of Tim Pope's Vim addons:

let mapleader="\<Space>"

" Window control/navigation leader mappings
nmap <leader>h <C-w>h
nmap <leader>j <C-w>j
nmap <leader>k <C-w>k
nmap <leader>l <C-w>l
nmap <leader>c <C-w>c

" Tab cycling
nmap [b gT
nmap ]b gt
like image 32
kitsu.eb Avatar answered Oct 13 '22 06:10

kitsu.eb