26

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.

David Miani
  • 14,518
  • 2
  • 47
  • 66
  • 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? – Cody Gray - on strike Apr 30 '14 at 07:14
  • @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) – David Miani Apr 30 '14 at 07:17
  • @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. – David Miani Apr 30 '14 at 12:34
  • @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. – David Miani Apr 30 '14 at 13:03
  • 1
    @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. – David Miani Apr 30 '14 at 13:29
  • 1
    @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. – David Miani Apr 30 '14 at 13:43
  • 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? – Fred Apr 30 '14 at 13:57
  • 1
    I found this two [extensions](http://stackoverflow.com/questions/4174386/moving-focus-to-next-tab-group-in-visual-studio-2008-visual-studio-2010-via-the). But they are made for vs2010 and vs2012. But they are both open source... – Jernej Gorički Jun 24 '14 at 17:52
  • @JonathanWilson: No unfortunately. – David Miani Nov 23 '14 at 01:27
  • @JernejGorički, .vsix extensions can often be hacked to work with a different version of VS, as described [here](http://stackoverflow.com/a/14087731/1783777). I got [VSStreamliner](https://visualstudiogallery.msdn.microsoft.com/6e2772e9-18e4-4409-8de4-8afec9e0603a) work with VS2015 in this way. – dinosaur Aug 12 '16 at 18:27

3 Answers3

26

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

zastrowm
  • 8,017
  • 3
  • 43
  • 63
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.]

Community
  • 1
  • 1
dinosaur
  • 3,164
  • 4
  • 28
  • 40
  • 1
    If you want to skip step 2, just download VSStreamliner2015 from [here](https://github.com/lrperlmu/VSStreamliner2015). – dinosaur Aug 12 '16 at 19:03
  • 2
    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` 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! – David Miani Aug 13 '16 at 07:56
-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.

Philip Pittle
  • 11,821
  • 8
  • 59
  • 123
  • 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. – David Miani Jan 30 '15 at 01:16
  • Going to last edit location is an official command in Visual Studio `Edit.GoToLastEditLocation` – NotAPro Feb 02 '22 at 11:51