Speed Up Keyboard Key Repeat on macOS with defaults
Use `defaults write` on InitialKeyRepeat and KeyRepeat to type faster than the System Settings sliders permit.
01Command
$ defaults write NSGlobalDomain InitialKeyRepeat -int 15 && defaults write NSGlobalDomain KeyRepeat -int 2 && echo 'Log out and back in to apply.'02What it does
InitialKeyRepeat is how long (in 15 ms units) a key must be held before repeating starts; KeyRepeat is the interval between repeats. The System Settings sliders cap these values, but defaults accepts lower numbers, so -int 15 (~225 ms delay) and -int 2 (~30 ms per repeat) feel dramatically faster for fast typists and terminal work. Settings apply after you log out and back in, and you can always restore the defaults by deleting both keys.
03Risk
04Undo
$ defaults delete NSGlobalDomain InitialKeyRepeat; defaults delete NSGlobalDomain KeyRepeat05Sources
- macOS defaults - read, write and delete macOS user defaultsEvidence: Documents `defaults write domain key -int value` — '-bool[ean]', '-int[eger]', '-float', '-string' value types for writing preference keys; the page also shows deleting keys with `defaults delete`.
- macOS setup dotfiles (.macos)Evidence: Sets the same keys verbatim: 'defaults write NSGlobalDomain KeyRepeat -int 1' and 'defaults write NSGlobalDomain InitialKeyRepeat -int 10' to speed up key repeat beyond the UI limits.
Last verified: 2026-09-19 · Category: System & Settings
06Related solutions
Point macOS screen captures at any folder you choose instead of the desktop.
Grab any file from the web straight into the current folder — no browser needed.
List the biggest files in your home folder that are eating disk space.