# Vim keys for window management on a Mac

Source: https://ribbonformac.com/vim-keys-window-management-mac  
Updated: 2026-10-29

macOS has no way to move between windows with <kbd>H</kbd>, <kbd>J</kbd>, <kbd>K</kbd> and <kbd>L</kbd>. A window manager adds it. The trick is picking a modifier that no app uses: <kbd>⌘</kbd> clashes with everything and <kbd>⌥</kbd> types special characters, so <kbd>⌃</kbd><kbd>⌥</kbd> together or a Hyper key are the usual choices. Ribbon's defaults are <kbd>⌃</kbd><kbd>⌥</kbd><kbd>H</kbd>/<kbd>J</kbd>/<kbd>K</kbd>/<kbd>L</kbd>.

## Choosing a modifier

| Modifier | Problem |
| --- | --- |
| <kbd>⌘</kbd> | <kbd>⌘</kbd><kbd>H</kbd> hides the app, <kbd>⌘</kbd><kbd>L</kbd> is the address bar, <kbd>⌘</kbd><kbd>K</kbd> is used by many apps. Clashes everywhere. |
| <kbd>⌥</kbd> alone | Types characters like ˙ ∆ ˚ ¬ on a US layout, and more on others. Fine if you never type those, a pain if you do. |
| <kbd>⌃</kbd> alone | <kbd>⌃</kbd><kbd>H</kbd>, <kbd>⌃</kbd><kbd>J</kbd>, <kbd>⌃</kbd><kbd>K</kbd> and <kbd>⌃</kbd><kbd>L</kbd> all mean something in terminals and text fields. |
| <kbd>⌃</kbd><kbd>⌥</kbd> | Almost nothing uses it. Two keys, but they sit side by side on Mac keyboards. |
| Hyper (<kbd>⌃</kbd><kbd>⌥</kbd><kbd>⇧</kbd><kbd>⌘</kbd> on Caps Lock) | No clashes, one finger. Needs a remapping tool. See [Hyper key on a Mac](https://ribbonformac.com/hyper-key-mac). |

## The window managers

All of these let you bind hjkl; they differ in what the keys do.

- **AeroSpace** (free) uses <kbd>⌥</kbd><kbd>H</kbd>/<kbd>J</kbd>/<kbd>K</kbd>/<kbd>L</kbd> by default to focus in its i3-style tree.
- **yabai** (free) has no keys of its own; you bind hjkl in a hotkey daemon such as skhd and call yabai commands.
- **Amethyst** (free) cycles focus through windows in its layout with its own default shortcuts, which you can change.
- **[Ribbon](https://ribbonformac.com/)** uses <kbd>⌃</kbd><kbd>⌥</kbd><kbd>H</kbd>/<kbd>J</kbd>/<kbd>K</kbd>/<kbd>L</kbd> out of the box.

## How hjkl works in Ribbon

Ribbon is a scrolling window manager: windows are columns on a horizontal strip, and a column can hold a stack of windows. So the four keys map naturally:

| Keys | Action |
| --- | --- |
| <kbd>⌃</kbd><kbd>⌥</kbd><kbd>H</kbd> / <kbd>L</kbd> | Focus the column to the left or right; the strip scrolls to follow |
| <kbd>⌃</kbd><kbd>⌥</kbd><kbd>J</kbd> / <kbd>K</kbd> | Focus down or up within a stacked column |
| <kbd>⌃</kbd><kbd>⌥</kbd><kbd>⇧</kbd><kbd>H</kbd>/<kbd>J</kbd>/<kbd>K</kbd>/<kbd>L</kbd> | Move the window in that direction |
| <kbd>⌃</kbd><kbd>⌥</kbd><kbd>1</kbd>–<kbd>9</kbd> | Jump to a window by position |
| <kbd>⌃</kbd><kbd>⌥</kbd><kbd>⌘</kbd><kbd>←</kbd> / <kbd>→</kbd> | First or last window on the strip |

The arrow keys work as well as hjkl, and every binding can be changed in Settings, including moving everything to a Hyper key. If you're coming from niri, the [niri keybindings guide](https://ribbonformac.com/niri-keybindings-mac) maps each bind. [Try hjkl in the live demo](https://ribbonformac.com/#demo); Ribbon is [$9.99 once](https://ribbonformac.com/#pricing).

## Vim keys beyond windows

- **Browser:** Vimium for Chromium browsers and Vimium-FF for Firefox give you <kbd>J</kbd>/<kbd>K</kbd> scrolling, <kbd>F</kbd> link hints and <kbd>H</kbd>/<kbd>L</kbd> history.
- **Text fields everywhere:** macOS supports Emacs-style keys (<kbd>⌃</kbd><kbd>A</kbd>, <kbd>⌃</kbd><kbd>E</kbd>, <kbd>⌃</kbd><kbd>N</kbd>, <kbd>⌃</kbd><kbd>P</kbd>) in nearly every app, which pair well with a Vim habit.
- **Editors:** VS Code has the Vim extension; JetBrains IDEs have IdeaVim; Zed has a built-in Vim mode.
- **Terminal multiplexers:** tmux panes are commonly bound to prefix plus hjkl. See [tmux or a window manager](https://ribbonformac.com/tmux-vs-window-manager-mac) for how they fit together.

## FAQ

### Can I use hjkl to switch windows on a Mac?

Not with built-in tools. A window manager adds it; Ribbon's defaults are <kbd>⌃</kbd><kbd>⌥</kbd><kbd>H</kbd>/<kbd>J</kbd>/<kbd>K</kbd>/<kbd>L</kbd>.

### Which modifier should I use for window shortcuts on macOS?

<kbd>⌃</kbd><kbd>⌥</kbd> or a Hyper key. <kbd>⌘</kbd> clashes with app shortcuts and <kbd>⌥</kbd> alone types special characters.

### Will Control-Option-H clash with anything?

Rarely. A few apps use <kbd>⌃</kbd><kbd>⌥</kbd> shortcuts, and VoiceOver uses <kbd>⌃</kbd><kbd>⌥</kbd> as its modifier while it's turned on. You can rebind any Ribbon shortcut.

## Keep reading
- [Use a Mac without a mouse](https://ribbonformac.com/use-mac-without-mouse) — Launching, menus, dialogs, the browser and windows, all from the keyboard.
- [Hyper key on Mac](https://ribbonformac.com/hyper-key-mac) — Caps Lock as Hyper with Raycast or Karabiner, the built-in option, and what to bind.
- [Linux keyboard habits on Mac](https://ribbonformac.com/linux-keyboard-shortcuts-on-mac) — Super, Ctrl and Cmd, terminal keys, Emacs bindings, remapping, and a WM layer.
- [Niri keybindings on Mac](https://ribbonformac.com/niri-keybindings-mac) — Each default niri bind next to its Ribbon shortcut, and the ones with no Mac twin.
- [Window keyboard shortcuts](https://ribbonformac.com/mac-window-keyboard-shortcuts) — Switching, hiding, closing, full screen, desktops and tiling, in one table.
