Search code examples
visual-studio-code

How do I press and hold a key and have it repeat in VSCode?


I use the vim plugin and I typically scroll in vim by just holding j. In VSCode holding j just does a single j command, no matter how long it's held for.

Even in vanilla vscode this also doesn't work - problematic if you're trying to type long blocks of ########################### for comment separators. Any idea how to enable this functionality?


Solution

  • To disable the Apple press and hold for VSCode only, run this command in a terminal:

    defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false
    

    Then restart VSCode.

    To re-enable, run this command in a terminal:

    defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool true