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.

macOSmacosTerminaldefaultskeyboardMedium risk
Run `defaults write NSGlobalDomain InitialKeyRepeat -int 15 && defaults write NSGlobalDomain KeyRepeat -int 2`, then log out and back in.

01Command

Command
$ 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

RiskMedium risk
!Warning: Extremely low KeyRepeat values (0–1) can feel uncontrollable on laptop keyboards; test before committing to them.

04Undo

Undo
$ defaults delete NSGlobalDomain InitialKeyRepeat; defaults delete NSGlobalDomain KeyRepeat

05Sources

  • macOS defaults - read, write and delete macOS user defaults
    SS64 · technical · 2026-09-17
    Evidence: 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)
    mathiasbynens/dotfiles (GitHub) · community · 2026-09-17
    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