Ian McNally

Repeating keys in vim on OSX

February 20, 2016

In vim, holding down a key can save you a lot of repeated effort. In newer versions of osx, holding down a key was disabled, to allow for a special character entry dialogue. In every blog post about disabling this feature, I found the blunt force approach of turning off it globally. It didn’t sit well with me, because sometimes I do want to use special characters, and it’s harder to do without the entry dialogue. 

The one weird trick to disable in vim? You can turn off the press-and-hold behavior for specific applications! For vim, it’s:

defaults write org.vim.MacVim ApplePressAndHoldEnabled -bool false

(Enter that in your terminal)

If you need to do this for other apps, check out the listings inside ~/Library/Preferences, and remove the .plist from end of the title (e.g., org.vim.MacVim.plist).

Happy coding!


Ian McNally

Hey, I'm Ian. I build websites and write about what I learn as I go. Follow me on Twitter.