How can I switch to a different tab group using the keyboard in visual studio 2013
Asked Answered
K

5

28

Consider the following window setup:

Window with 2 tag groups

Currently there are two tab groups open. The left tab group is active (with the ListingDetailsDTO.cs window active).

I would now like to switch to the right tab group, so visual studio will appear like this:

Right tab group active

This is easily possible using the mouse (ie just left click the right window). However I cannot figure out how to do it with the keyboard alone. Assigning a shortcut to Window -> Move to next tab group came closest, but it also moves the current window to the next tab group, which isn't what I wanted. I thought Window.NextPane, or Window.NextSubpane might work, but they didn't.

Is there a way to do what I want? I am happy to install (preferably) free extensions to make this possible if necessary.

Kathie answered 30/4, 2014 at 7:12 Comment(10)
What did Window.NextPane do? I'd expect that would work, unless it's moving you to a toolbox window instead. What about Window.NextDocumentWindow, which I believe by default is assigned to Ctrl+Tab?Structural
@CodyGray: Ctrl-Tab moves to the previously selected window. Eg If I selected IListingService.cs, then ListingDetailsDTO.cs, pressing Ctrl-tab will move to IListingService.cs rather than ListingUpdateDTO.cs. Window.NextPane moves you to toolbox windows unfortunately (it is bound by default to alt-f6)Kathie
@Fred: That loops through all windows. For example, starting with ListingDetailsDTO.cs active, C-S-F6 jumps to ListingUpdateaDTO.cs (like I want). But C-S-f6 a second time will jump to IListingService.cs, and a third time will switch to ListingDetailsDTO.cs. I just want to jump between different visible files, without ever changing the active tab.Kathie
@HansPassant: You're right, those two commands move the current active window to the next/previous tab group. I just want the focus to move to the next/previous tab group, without moving any windows.Kathie
@Fred, no, I will have two similar files open (eg two controllers, two data types), and would like to copy code between the two files easily, as well as scrolling each independently without having to use the mouse all the time. I will usually have many other tabs open at the same time in both tab groups. Basically, I want something like emacs C-X C-O.Kathie
@Fred: That does work, but is pretty tedious, and needs repeating every time you visit a new tab (since the tab order will change). With a switch to next tab group command, as long as the window you want to switch to is visible, it will work. If you have ever used multiple window splits in emacs or vim, you will understand the benefit of such a command. It is looking like the command doesn't exist though, so you are right that Ctrl-Tab is a somewhat decent substitute.Kathie
What if you open another instance of VS and then just Alt-Tab between them to get to the group you want? Would that work for you?Harry
I found this two extensions. But they are made for vs2010 and vs2012. But they are both open source...Roderick
@JonathanWilson: No unfortunately.Kathie
@JernejGorički, .vsix extensions can often be hacked to work with a different version of VS, as described here. I got VSStreamliner work with VS2015 in this way.Bobseine
B
5

This is possible using the VSStreamliner extension. Only caveat is that the lastet version I know of is for VS2010. Fortunately, there's a hack-around -- I have gotten it to work with VS2015.

  1. Download VSStreamliner.

  2. Edit the extension's version to match your version of Visual Studio, as described here.

  3. Install the version-hacked extension. This provides commands Window.NextDocumentUp, Window.NextDocumentDown, Window.NextDocumentLeft and Window.NextDocumentRight.

  4. In VS, go to Tools -> Options -> Environment -> Keyboard, and set your desired keybindings to those commands. [Emacs users: For some reason "C-x o" didn't work. (Maybe VS doesn't like two-stroke bindings?), so I used "M-o" and "M-p" for NextDocumentDown and NextDocumentUp respectively.]

Bobseine answered 12/8, 2016 at 18:41 Comment(2)
If you want to skip step 2, just download VSStreamliner2015 from here.Bobseine
This completely fixes the problem! I used the extension linked in your comment, and set keybindings, and it worked just as expected. Not only that, but you can assign the window movement keys in VsVim, e.g. map gh :vsc Window.NextDocumentLeft<CR> in your .vsvimrc file. Thank you for taking the time to answer a 2 year old question, I had given up on ever finding a solution to this!Kathie
A
27

For Visual Studio 2017/2019, I created an open-source extension to do this:

It by default adds two keyboard shortcuts:

  • Tools.NavigateTabGroups.Next (CTRL+SHIFT+Right) to move to the next tab group
  • Tools.NavigateTabGroups.Previous (CTRL+SHIFT+Left) to move to the previous group

There are six commands altogether (all of which can be assigned shortcuts):

image showing all six commands from the tools menu

Antaeus answered 7/7, 2017 at 2:1 Comment(2)
Exactly what I was looking for. Thank you!Hackney
Sadly VS2022 still doesn't support this natively, and the plugin above which I personally loved and used for years hasn't support it yet. I guess someone still need to cover the MS's ass... Sign...Fredia
B
5

This is possible using the VSStreamliner extension. Only caveat is that the lastet version I know of is for VS2010. Fortunately, there's a hack-around -- I have gotten it to work with VS2015.

  1. Download VSStreamliner.

  2. Edit the extension's version to match your version of Visual Studio, as described here.

  3. Install the version-hacked extension. This provides commands Window.NextDocumentUp, Window.NextDocumentDown, Window.NextDocumentLeft and Window.NextDocumentRight.

  4. In VS, go to Tools -> Options -> Environment -> Keyboard, and set your desired keybindings to those commands. [Emacs users: For some reason "C-x o" didn't work. (Maybe VS doesn't like two-stroke bindings?), so I used "M-o" and "M-p" for NextDocumentDown and NextDocumentUp respectively.]

Bobseine answered 12/8, 2016 at 18:41 Comment(2)
If you want to skip step 2, just download VSStreamliner2015 from here.Bobseine
This completely fixes the problem! I used the extension linked in your comment, and set keybindings, and it worked just as expected. Not only that, but you can assign the window movement keys in VsVim, e.g. map gh :vsc Window.NextDocumentLeft<CR> in your .vsvimrc file. Thank you for taking the time to answer a 2 year old question, I had given up on ever finding a solution to this!Kathie
F
0

UPDATE 08/07/2024

Since Microsoft broken a feature described below, this answer is no longer valid


In Visual Studio 2022 it is still not available, but I can provide some workaround. If you are in file A in group Tab G1 and then you go to file B in group Tab G2, now you should be allowed to switch between those two files with just ctrl + r, ctrl + e (Go to recent files) + enter

If you are in file A and you open file C in group Tab G1, now you cannot just use above method. However, you can still use shortcut ctrl + r, ctrl + e and file B should be on second position in "recent files" list. So you need to go down one position and you can hit enter to visit file B

Farrel answered 19/11, 2023 at 21:11 Comment(0)
M
0

group 1: Ctrl 1 group 2: Ctrl 2 ...

Group Left: Ctrl + K Ctrl + LeftArrow Group Right: Ctrl + K Ctrl + RightArrow

Myrna answered 17/5, 2024 at 5:2 Comment(0)
B
-2

I can do this with Ctrl + Shift + Backspace.

I am not sure if this is because of an extension or is out-of-box behavior. I use ReSharper and Productivity Power Tools 2013 for productivity extensions so if it's not out-of-box, one of these did it.

Brahma answered 29/1, 2015 at 15:30 Comment(2)
ReSharper has the command Resharper.ReSharper_GotoLastEditLocation bound to this key. While useful, it doesn't allow switching between the edit groups unless the active file in the other edit group was the last one edited. That is how it works for me anyway - you may have it bound to something else.Kathie
Going to last edit location is an official command in Visual Studio Edit.GoToLastEditLocationApocope

© 2022 - 2025 — McMap. All rights reserved.