VimSenseiStartarrow_forward
/ setup guide·5 min read·beginner

Remap Caps Lock for the Vim-pilled.

Caps Lock is in the best position on your keyboard and does the worst job. We're going to fix that — one key that acts as Control when held and Escape when tapped.

/ 01

Why this matters

In Vim, you hit Esc and Ctrl dozens of times per minute. They live in the worst places on the keyboard. Caps Lock lives in the best place on the keyboard and does nothing useful. Remapping it is the single highest-leverage tweak you will ever make.

/ 02

Choose your OS

Pick your platform below. The instructions in section 03 will switch to match.

/ 03

Follow the steps

● Showing instructions for macOS
  1. 01

    Install Karabiner-Elements

    Karabiner-Elements is a free, open-source keyboard customizer for macOS. Native macOS can map Caps Lock to Control via System Settings, but it can't do hold-vs-tap — that's the whole reason we need Karabiner. Skip the System Settings remap; Karabiner handles everything.

    Download the installer from the official site and run it. You'll need to grant it Input Monitoring access on first launch (System Settings → Privacy & Security).

  2. 02

    Add the Complex Modification rule

    Open Karabiner-Elements → Complex Modifications tab → Add predefined ruleImport more rules from the Internet, or paste the rule below directly into your config file.

    // ~/.config/karabiner/karabiner.json
    {
    "description": "Caps Lock → Ctrl (hold) / Esc (tap)",
    "manipulators": [{
      "type": "basic",
      "from": { "key_code": "caps_lock" },
      "to": [{ "key_code": "left_control" }],
      "to_if_alone": [{ "key_code": "escape" }]
    }]
    }

    The to_if_alone field is what makes hold-vs-tap work: hold the key and Karabiner sends Control; tap and release within ~250ms and it sends Escape instead.

/ 04

Verify it works

Open a terminal and run through this checklist. Every line should produce the marked behaviour. If any one fails, the daemon (keyd / Karabiner / AHK) probably isn't running — check it before retrying.

~/testready
$ tap caps lock                         // nothing happens — no CAPS LOCK light
$ hold caps lock + C                    // ✓ sends Ctrl+C
$ open vim, press i then tap caps       // ✓ exits INSERT mode

// if any step fails, check that keyd / karabiner / ahk is running
/ Helpful?

Was this guide useful? One tap, no signup needed.

/ 05 — Now Practice

New keybinding → new muscle memory.

Reading only gets you so far. Your fingers need reps.