12

When I have two applications open side-by-side in the same space, I'd like to be able to swap between them quickly with the keyboard.

I can use Command+Tab, but often I land on an application in a different space, and it moves me to that space.

Is there a similar shortcut which limits the list of applications to the current space?

(I'm using OSX Snow Leopard.)

1
  • Could you update your details? "when I have two applications open side-by-side" would better read "when I have two windows open side-by-side" based on the top two answers. Commented Aug 20, 2015 at 14:11

4 Answers 4

9

Move focus to active or next window (⌃F4). It cycles through visible windows (not applications) on the current space.

I've assigned it to ⌥⇥ myself, and assigned ⌥T to what ⌥⇥ would do normally: d=~/Library/KeyBindings; mkdir -p $d; echo $'{\n\t"~t" = insertTabIgnoringFieldEditor:;\n}' > $d/DefaultKeyBinding.dict.

3
  • 1
    This is very close to what I want, and good enough to do the job 90% of the time. :) For those struggling to decipher ⌃F4, it means "Control-Fn-F4" (as I discovered by double-clicking the shortcut in the window shown above and hovering over the text). Commented Oct 26, 2011 at 14:30
  • Somehow it doesn't work in certain cases. For me it doesn't work when I move from, say spaceB(3 windows) to spaceA(2 windows) In this case when I try to switch windows in spaceA, it moves back to spaceA. I'm not sure why, but it is really annoying. Like @NathanLong says it works 90% of the time though.
    – Crocode
    Commented Jul 23, 2014 at 21:56
  • Yes, I have same problem here that ^F4 will just jump between spaces.
    – vancewang
    Commented Jul 29, 2018 at 17:53
6

I don't know of any keyboard shortcuts; but consider the following program.

http://manytricks.com/witch/

1
  • I had the very same problem, and this is the best solution; comparatively, Ctrl+F4 is suboptimal, since it doesn't show any list of applications.
    – Marcus
    Commented Sep 27, 2013 at 8:01
4

If you go to System Preferences, Mission Control and then untick the second box ("When switching to an application, switch to a Space with open windows for that application") that should fix it I think.

0

For anyone willing to install and use Hammerspoon, this configuration will bind this feature to `:

~/.hammerspoon/init.lua

local function focus_next()
    -- Filter out windows without titles and non-standard windows
    local valid_windows = hs.fnutils.filter(hs.window.orderedWindows(), function(win)
        return win:title() ~= "" and win:isStandard()
    end)

    -- If there are more than one valid window, focus the next one
    if #valid_windows > 1 then
        local current_win = hs.window.focusedWindow()
        local current_index = hs.fnutils.indexOf(valid_windows, current_win) or 0
        local next_index = (current_index % #valid_windows) + 1
        valid_windows[next_index]:focus()
    end
end

hs.hotkey.bind({ "ctrl" }, "'", focus_next)

Somewhat unexpectedly, it works perfectly together with Stage Manager and in fullscreen Split View.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .