Vim: holding down navigation button

Created on 22 Jun 2016  路  18Comments  路  Source: VSCodeVim/Vim

(i'm on mac os x.)

holding 'j' down to continue to scroll down doesn't work. (nor does ctrl+d, which deletes the following character, even on insert mode).

is there a system setting i need to tweak or is that simply not supported?

for WebStorm for example:
defaults write com.jetbrains.WebStorm ApplePressAndHoldEnabled -bool false seemed to solve the problem.

Guessed with com.Microsoft.VisualStudioCode, but didn't seem to solve the issue. Help!

Most helpful comment

Compiling these awesome answers, this is what I did (for future reference for lazy people like me).

  1. Run the following command in the terminal (which will not have a global effect):
    defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false
  2. Restart the computer.
  3. Open VSCode and hold down j like there is no tomorrow. 馃憣

All 18 comments

This totally works for me, also OSX.

Could you do me a favor and try with a fresh install of VSC?

Does repeating a key work in a basic textbox on OSX? Like, if you leave a comment here on github and press down j, does it repeat a lot, or no? There is an OSX OS-level pref that can affect this.

Try this (found in the Vintageous documentation):

defaults write com.sublimetext.3 ApplePressAndHoldEnabled -bool false

Run into the same situation. This works perfectly on Windows but no luck with OSX.

@rebornix can you try running defaults write com.sublimetext.3 ApplePressAndHoldEnabled -bool false in your terminal on OSX? It'll actually make key repeats work systemwide, though you can disable it by running it again with true.

I've tried that (even with admin privilege) and restart VS Code Insider but it still doesn't work. I noticed this on my rmbp the first day I used this extension but then I switched to Windows. Now I'm working on Mac again and it turned out to be a problem.

Weird! And when holding down keys in other textboxes, it works fine?

Oh wait, I can't even do this with Chrome, so it can be out of this extension or VS Code. But we still need a clear workaround or guidance about this.

Ahh, okay.

I don't think a workaround is possible because VSC does not trigger events for key on/key off, only keystroke registered.

We can definitely let users know about it though. We could have some sort of visible FAQ...

I'm Okay to close this issue as it has nothing with both the ext or the editor. Currently I can only repeat keys in terminal, but I'll say it's my Mac's problem.

馃憤

OH duh, no wonder that command I gave didn't work. It's for Sublime Text. I'm a dumb.

I'm sure VSCode has an equivalent, but I have no clue what it is, or why it appears to be set for me.

Finally figure out how to fix it. After running the command @johnfn provided, remember to reboot the system. It's documented here https://discussions.apple.com/thread/6058293?tstart=0

Are you sure it was my command? it has com.sublimetext.3 in it, which I assumed meant it was ST3 only.

It should be defaults write -g ApplePressAndHoldEnabled -bool false but people should be careful about this global effect.

Compiling these awesome answers, this is what I did (for future reference for lazy people like me).

  1. Run the following command in the terminal (which will not have a global effect):
    defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false
  2. Restart the computer.
  3. Open VSCode and hold down j like there is no tomorrow. 馃憣

For insider:

defaults write com.microsoft.VSCodeInsiders ApplePressAndHoldEnabled -bool false

I just restarted vscode insider and it works.

FYI, this is all in our readme https://github.com/VSCodeVim/Vim/blob/master/README.md#mac-setup

@danilojunS Thank you! That's working!

Was this page helpful?
0 / 5 - 0 ratings