Skip to main content

Fixing Vim Mode in MacOS

·234 words·2 mins
Yilin Fang
Author
Yilin Fang
PhD Student @ OSU CSE

If you use Vim-style keybindings or Vim mode in VSCode, Cursor, Antigravity or Obsidian, you might have hit this problem:

Hoding j or k does NOT repeat – instead macOS shows the accent picker (é, ñ, ö, …)

This completely breaks Vim-style navigation, because Vim relies on the key repeat not press-and-hold.

Here is how to fix it properly for any app on MacOS.

NOTE: Tested on MacOS 15.7.3

Disable it globally (simple but not recommended)#

If you want Vim-style behavior everywhere:

defaults write -g ApplePressAndHoldEnabled -bool false

Then log out and log back in (or reboot).

Disable it for a specific app (recommended)#

This is best you only want to affect editors which use Vim-style keybindings.

Find the app’s bundle ID
#

Run:

osascript -e 'id of app "APP_NAME"'

Examples:

osascript -e 'id of app "Visual Studio Code"'
osascript -e 'id of app "Obsidian"'
osascript -e 'id of app "Cursor"'
osascript -e 'id of app "Antigravity"'

Example output:

com.microsoft.VSCode
md.obsidian
com.todesktop.230313mzl4w4u92
com.google.antigravity

Disable it for the app
#

Run:

defaults write APP_BUNDLE_ID ApplePressAndHoldEnabled -bool false

Example:

defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false
defaults write com.todesktop.230313mzl4w4u92 ApplePressAndHoldEnabled -bool false

Then restart the app.

TL;DR
#

# Find app's bundle ID
osascript -e 'id of app "APP_NAME"'
# Disable press-and-hold for that app
defaults write <bundle-id> ApplePressAndHoldEnabled -bool false
# Or disable it globally
defaults write -g ApplePressAndHoldEnabled -bool false

Last updated: 2026-01-06