22

As a long time Windows users I'm used to switch between two windows using keyboard. Now at Mac I just can't figure out how to do that!

Command-Tab works nicely between apps, but how to do the same within one application having several windows open? Especially when using XCode? For example within Firefox you can do control-tab and control-shift-tab to navigate between tabs. Doesn't work with XCode, not between two different open projects.

Doing 4-fingers-down, looking at screen, finding the previous window and clicking on it with mouse takes waaaay too long time. It interrupts whatever I was doing, distracts from whatever I was thinking about and starts annoying me - enough to write this desperate call for help in StackOverflow :)

There's got to be a secret handsha... keyboard combination!

Jonik
  • 5,940

8 Answers8

15

Before this is moved to superuser, the shortcut you're looking for is command-`

8

Command-Tab works nicely between apps, but how to do the same within one application having several windows open?

I was also a bit annoyed at this, until I found the "Move focus to the next window in application" keyboard shortcut option (under System Preferences -> Keyboard -> Keyboard Shortcuts -> Keyboard & Text Input).

I set it to Cmd-§ (⌘§) myself (which is close to Cmd-Tab and I couldn't think of anything better). Shift-Cmd-§ cycles in the opposite direction. It's not ideal, but sort of tolerable for me, although I'd still prefer Cmd-Tab toggling between all windows.

There are also 3rd party utilities that improve OS X's window switching capabilities; check out Witch for instance. I haven't tried these myself though.

Jonik
  • 5,940
5

Hyperswitch (free) and Witch ($14, though more configurable) allow doing this.

5

When you have to window active (focused), do Command-~.

tranmq
  • 151
3

If you want to make a custom shortcut, I noticed that macOS Sierra seems to automatically map Shift-[shortcut here] to the reverse of your original shortcut, when it makes sense (e.g. anything that involves "next" probably has a corresponding "previous" version). Possibly because someone expected that a user would expect this to happen?

So if you look in System Preferences > Keyboard > Shortcuts > Keyboard you'll only find "Move focus to next window" bound by default to Command-` and this is why Command-Shift-` triggers "Move focus to last window."

Set "Move focus to next window" to any other combination that doesn't involve Shift, and Shift-[that combination] will do "Move focus to last window".

mz496
  • 131
2

I found this decision tree for finding the right shortcut:

Decision tree for last window shortcut on mac

Decision tree for last window shortcut on mac

The main decisions are:

  • Was it in a different Program from the one you want to switch from?
  • Is the other Window on the same Desk?
  • Do you use a "QWERTY" Keyboard layout?
  • Is this the previous window you used?

It shows that it's not easy. The source (xpt.de) choose to use a third party app called Hyperswitch.

Patrick
  • 21
0

To switch to the previous / next window of the same tab (macOS):

  • Cmd ⌘ `

  • Cmd ⌘ Shift ⇧ `

The order depends on the keyboard layout (UK / US).


Based on the answers from: Shortcut for toggling between different windows of same app?:

ellockie
  • 181
-1

try "cmd" + "<" within xcode. It works with my keyboard - KK