'OS X: cycle between windows in visual studio code

I'm trying desperately to figure out how to cycle through windows in Visual studio code. In Finder, there is a menu item Cycle Through Windows which I use frequently. However, this seems to be a Finder option. So I looked through the global shortcuts (since the requirement is probably the same for many applications) and assigned the Move focus to next window to shift-cmd-F1. This works in Finder and Text Editor, but not in Visual Studio Code. I checked if the key binding is overridden in VSC but I don't think so.

Has anyone got this figured out and can help me?

edit: just found that this is a global shortcut under System Settings > Keyboard > Shortcuts > Move focus to the next window. Unfortunately, Visual Code doesn't use it.



Solution 1:[1]

I added the following shortcut to keybindings.json

{
    "key": "alt+tab",
    "command": "workbench.action.quickSwitchWindow"
}

workbench.action.quickSwitchWindow does exactly what I want and it has no default shortcut enabled (on a spanish keyboard at least).

Solution 2:[2]

So, finally found the solution: Though for some reason the system-wide shortcut for Move focus to next window does not work, there is another shortcut which does: shift+cmd+~ :)

Found it here: https://support.apple.com/en-us/HT201236

Solution 3:[3]

You can use Switch window from command palette (command: workbench.action.switchWindow). The default shortcut is Ctrl + w.

It lists all the open windows for you to select and go.

It's improved further.

Solution 4:[4]

command ? + ` is working nicely for me on macbook Pro.

Solution 5:[5]

shift ? + command ? + ~ works for me unless I am in full screen mode. Alternatively, you can use the following shortcuts in full screen:

shift ? + command ? + p then type "Switch Window".

Solution 6:[6]

The newest version of Visual Code (1.55.2) has window switching enabled by default. The hot key is Control+W (?+W), which will bring down a command window for you to select which window to jump to.

Solution 7:[7]

There seem to be tons of ways to cycle windows. I finally found one that worked for me:

shift + cmd + "{" or "}"

If you go to "window" in the application you'll see menu items for "Next Document" and "Previous Document".

Solution 8:[8]

Just FYI, the shortcut for Ubuntu(Gnome 3) is alt + ` for switch between visual studio code (or other applications) windows.

Solution 9:[9]

Set the Quick Switch Window... keyboard shortcut to command+N is a better work around for me.

Go to the menu Code/Preferences/Keybord Shortcuts and search for quickSwitchWindow

Solution 10:[10]

if you know how to open keybodard shortcuts from vscode, type "switch" in input box which has a placeholder "Type to search in Keybindings". you will see "switch window...".

i am using macbook and ^ + W is an default shortcut key for switching windows in between.

Solution 11:[11]

To cycle through windows that are in the same desktop, I use :

shift + command + `

Mac OS 12.2. Azerty, and VS Code 1.64.2

Solution 12:[12]

None of cmd+` cmd+shift+F1 or shift+cmd+~ work for me but ctrl+cmd+\ does.

I'm using a UK Windows keyboard layout - not sure if that affected it..

Edit: I originally found that cmd+\ was working but having restarted VS Code that changed to ctrl+cmd+\ - very odd

Solution 13:[13]

Personally, I rather use quickOpenRecent instead of quickSwitchWindow because it allows me to quickly switch between the last used window and the current one (stacked cycling instead of sequential). I have the following mapped to alt+tab:

{
  "key": "alt+tab",
  "command": "workbench.action.quickOpenRecent",
  "when": "!inRecentFilesPicker"
},
{
  "key": "alt+tab",
  "command": "workbench.action.quickOpenNavigateNextInRecentFilesPicker",
  "when": "inQuickOpen && inRecentFilesPicker"
},
{
  "key": "shift+alt+tab",
  "command": "workbench.action.quickOpenNavigatePreviousInRecentFilesPicker",
  "when": "inQuickOpen && inRecentFilesPicker"
}