Runcible
Runcible

Reputation: 7372

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.

Upvotes: 12

Views: 8368

Answers (4)

kitsu.eb
kitsu.eb

Reputation: 3066

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

Upvotes: 1

Keith Nicholas
Keith Nicholas

Reputation: 44288

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 >

Upvotes: 3

Garry H
Garry H

Reputation: 111

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.

Upvotes: 6

Runcible
Runcible

Reputation: 7372

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

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

Upvotes: 11

Related Questions