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.