Unified keyboard configuration for macOS (MacBook built-in keyboard and NuPhy Air75).
This repository contains a Kanata configuration for macOS. It maps keys identically across internal laptop keyboards and external keyboards.
Caps Lock:- Tap:
Escape - Double Tap:
Caps Lock - Hold: Navigation & Editing Layer
- Tap:
Tab:- Tap:
Tab - Hold: Hyper Key (
Cmd + Option + Ctrl + Shift)
- Tap:
Space:- Tap:
Space - Hold: Numpad & Symbols Layer
- Tap:
Vim navigation, dedicated scrolling, macOS text selection modifiers, and clipboard shortcuts without leaving the home row.
┌────┬────┬────┬────┬────┬────┬────┬────┬────┬────┬────┬────┬────┬────────┐
│ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ DEL │
├────┴─┬──┴─┬──┴─┬──┴─┬──┴─┬──┴─┬──┴─┬──┴─┬──┴─┬──┴─┬──┴─┬──┴─┬──┴─┬──────┤
│ TAB │ │ │ │ │ │ │HOM │PGD │PGU │END │ │ │ │
├──────┴┬───┴┬───┴┬───┴┬───┴┬───┴┬───┴┬───┴┬───┴┬───┴┬───┴┬───┴┬───┴──────┤
│ [HOLD]│CTL │ALT │CMD │SFT │ │ ← │ ↓ │ ↑ │ → │ │ │ RET │
├───────┴─┬──┴─┬──┴─┬──┴─┬──┴─┬──┴─┬──┴─┬──┴─┬──┴─┬──┴─┬──┴─┬──┴──────────┤
│ SHIFT │UND │CUT │CPY │PST │ │ │ │ │ │ │ SHIFT │
├─────┬───┴─┬──┴──┬─┴────┴────┴────┴────┴────┴────┴────┴┬───┴─┬─────┬─────┤
│ CTL │ OPT │ CMD │ SPACE │ CMD │ OPT │ CTL │
└─────┴─────┴─────┴─────────────────────────────────────┴─────┴─────┴─────┘
| Key | Action | Purpose |
|---|---|---|
H J K L |
← ↓ ↑ → |
Directional navigation |
U I O P |
Home PgDn PgUp End |
Document and scroll navigation |
A S D F |
Ctrl Alt Cmd Shift |
Modifiers for macOS text selection |
Z X C V |
Cmd+Z Cmd+X Cmd+C Cmd+V |
Undo, Cut, Copy, and Paste shortcuts |
Backspace |
Forward Delete |
Forward delete character |
Text Selection:
Caps (Hold)+F(Shift) +L$\rightarrow$ Select characters right.Caps (Hold)+S(Alt) +L$\rightarrow$ Move forward one word.Caps (Hold)+D(Cmd) +L$\rightarrow$ Move to end of line.Caps (Hold)+D+F(Cmd+Shift) +L$\rightarrow$ Select to end of line with index and middle fingers.
A 10-key numeric keypad on the right hand and common programming symbols on the left hand.
┌────┬────┬────┬────┬────┬────┬────┬────┬────┬────┬────┬────┬────┬────────┐
│ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ BSPC │
├────┴─┬──┴─┬──┴─┬──┴─┬──┴─┬──┴─┬──┴─┬──┴─┬──┴─┬──┴─┬──┴─┬──┴─┬──┴─┬──────┤
│ TAB │ ! │ @ │ # │ $ │ % │ │ 7 │ 8 │ 9 │ + │ - │ │ │
├──────┴┬───┴┬───┴┬───┴┬───┴┬───┴┬───┴┬───┴┬───┴┬───┴┬───┴┬───┴┬───┴──────┤
│ CAPS │ ^ │ & │ * │ ( │ ) │ │ 4 │ 5 │ 6 │ * │ / │ = │
├───────┴─┬──┴─┬──┴─┬──┴─┬──┴─┬──┴─┬──┴─┬──┴─┬──┴─┬──┴─┬──┴─┬──┴──────────┤
│ SHIFT │ ~ │ ` │ [ │ ] │ | │ 0 │ 1 │ 2 │ 3 │ . │ SHIFT │
├─────┬───┴─┬──┴──┬─┴────┴────┴────┴────┴────┴────┴────┴┬───┴─┬─────┬─────┤
│ CTL │ OPT │ CMD │ [HOLD] │ CMD │ OPT │ CTL │
└─────┴─────┴─────┴─────────────────────────────────────┴─────┴─────┴─────┘
Clone the repository and run setup:
cd ~/silentcastle/projects/kanata-conf
make installmake install performs these setup steps:
- Installs
kanatawith Homebrew. - Installs the matching
Karabiner-DriverKit-VirtualHIDDevicepackage. - Sets up the system
LaunchDaemonfor driver communication. - Symlinks
~/.config/kanata/kanata.kbdto this repository. - Checks configuration syntax and starts the background service.
Run make uninstall as your normal user, without sudo. The command stops and
removes the Homebrew Kanata service and package. It removes this repository's
driver launch daemon and runs the installed Karabiner driver's official
uninstall scripts. Homebrew runs as your normal user. The command stops the old
root service with launchctl. It repairs Kanata's Homebrew file ownership
before removal. Follow the macOS prompts for administrator approval. The
command preserves this repository and ~/.config/kanata. You can run the
command again after removal.
The driver is shared with other remapping tools. If Karabiner-Elements is
installed, the command stops before it makes changes. Use its uninstaller
first. After removal, run systemextensionsctl list. Restart macOS if removal
is pending. You can remove Kanata's old entries from Input Monitoring and
Accessibility in System Settings.
Kanata requires two permissions in System Settings > Privacy & Security (run make permissions to auto-open these panes):
- Input Monitoring (
Privacy & Security > Input Monitoring):- Toggle
kanatato ON (blue). - If
kanatais not listed: Click+, press Cmd+Shift+G, paste/opt/homebrew/bin/kanata, click Open, and toggle it ON.
- Toggle
- Accessibility (
Privacy & Security > Accessibility):- Ensure
kanatais toggled ON.
- Ensure
Once granted, start or reload the background service with make start or make reload.
Kanata communicates with the Karabiner DriverKit extension through an internal IPC protocol. The DriverKit version must match the protocol version in Kanata. See the Kanata macOS Setup Guide:
| Kanata Version | IPC Protocol | Required Karabiner DriverKit | Notes |
|---|---|---|---|
v1.12.x and below |
Protocol 5 | v6.2.0 |
Homebrew stable version |
v1.13.0 and above |
Protocol 7 | v8.0.0 / v8.2.0+ |
Uses updated karabiner-driverkit crate |
Note
The setup.sh script detects your installed kanata version and downloads the matching DriverKit package automatically.
# Restart background service after editing kanata.kbd
make reload
# Check background daemon status
make status
# Stop the background service
make stop
# Start the background service
make start
# Test in foreground with live layer change logs
make testEdit kanata.kbd to change timings or key mappings:
- Tap-Hold Timings (
defvar): Changetap-time(180ms),hold-time(200ms), andspace-hold-time(230ms) in the(defvar ...)block at the top ofkanata.kbd. - Symlink: Run
make linkto link~/.config/kanata/kanata.kbdtokanata.kbdin this repository.
See CHANGELOG.md for release history following Keep a Changelog.