Key down repeat with Vim extension

I did not enable vim mode when first install in but have since installed the Vim extension.

I followed the instructions for enabling keydown repeating from the Vim docs and it worked for VSCode, but not for Cursor.

To enable key-repeating, execute the following in your Terminal, log out and back in, and then restart VS Code:

$ defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false              # For VS Code
$ defaults write com.microsoft.VSCodeInsiders ApplePressAndHoldEnabled -bool false      # For VS Code Insider
$ defaults write com.vscodium ApplePressAndHoldEnabled -bool false                      # For VS Codium
$ defaults write com.microsoft.VSCodeExploration ApplePressAndHoldEnabled -bool false   # For VS Codium Exploration users
$ defaults delete -g ApplePressAndHoldEnabled

Maybe it’s because there is no sign out/sign back in possibility in Cursor?

Wondering if anyone has gotten this to work.

5 Likes

Ok, I figured it out, first you need to get Cursor’s id:

$ osascript -e 'id of app "Cursor"'
mine looked like this: com.todesktop.230313mzl4w4u92

Then do:

$defaults write <app id goes here> ApplePressAndHoldEnabled -bool false

And restart Cursor :boom:

8 Likes

Small precision for the people in the same case:
You have to truly quit Cursor, from the dock by example, before restarting it (quitting the app from the top-left red button will not be enough).

Thanks this solves the problem!

For oneliner

defaults write “$(osascript -e ‘id of app “Cursor”’)” ApplePressAndHoldEnabled -bool false

Awesome! Thanks did the trick!

0:1: syntax error: A unknown token can’t go here. (-2740)

And in case anyone sees this not working for them, it is probably because the double quotes copied weirdly. I’ll paste what worked for me, but try typing it out yourself in your terminal manually (instead of copy/paste).

defaults write "$(osascript -e 'id of app "Cursor"')" ApplePressAndHoldEnabled -bool false

2 Likes

This is what I needed. Thank you!

So helpful!