Macvim: Holding down navigation keys (H, J, K, L) doesn't repeat them

Created on 6 Sep 2016  Â·  4Comments  Â·  Source: macvim-dev/macvim

In command-line Vim (normal mode), when I want to navigate a file, I can simply hold down the 'J' key and navigate downwards until the end of the file (holding down repeats the command). The issue with MacVim is that I hold down the 'J' key and it only works for one row. This means I have to keep tapping the key over and over to navigate downwards. The arrow keys work fine, only the navigation keys ('H', 'J', 'K' and 'L') seem to be affected. Also, using 'ctrl-B' and 'ctrl-F' works as expected and I get to the bottom of the document without having to constantly tap.

I know there's an issue (erm… feature) with OSX ever since Lion and holding down a key shows key alternatives instead of repeating (see http://osxdaily.com/2011/08/04/enable-key-repeat-mac-os-x-lion/) but this is not my problem. I've already deactivated the OSX pop-up. And when in insert mode I can just hold down 'J' and it repeats automatically.

If anything about my description was unclear, or if there are any questions, please ask. I really use MacVim a lot and would be thankful for a fix.

My System:

  • MacBook Pro (Retina, 13-inch, Early 2015),
  • OSX El Capitan, Version 10.11.6 (15G31)
  • MacVim, Version 7.4 (107) - tested with an empty .vimrc file

Most helpful comment

The ApplePressAndHoldEnabled does in fact affect MacVim. (reference: http://deferred.io/2015/08/03/macvim-disable-press-and-hold.html).

It's easy to disable though:
defaults write org.vim.MacVim ApplePressAndHoldEnabled -bool false

Nice thing about the above command is that you can still have press-and-hold enabled for other apps.

Note that you must quit the MacVim application and relaunch it. If I didn't relaunch, but only opened a new window by typing mvim in Terminal, that window doesn't have the setting applied.

All 4 comments

I've just tested this on a different MacBook Pro (Retina, 13-inch, Early 2015) with El Capitan, version 10.11.6 (15G1004) and MacVim, version 7.4 (107). On this one it works. So the problem might just be local. I'll keep trying to figure it out.

What is your key repeat set to in System Preferences, under Keyboard?

OK, two days later it works again. I have no idea what happened, nor what fixed it. Anyway, it doesn't look like a bug anymore. Sorry for the trouble.

These are my key repeat settings but I don't think that was it. Maybe playing around with the 'ApplePressAndHoldEnabled' setting had something to do with it.

screenshot 2016-09-08 14 44 37

The ApplePressAndHoldEnabled does in fact affect MacVim. (reference: http://deferred.io/2015/08/03/macvim-disable-press-and-hold.html).

It's easy to disable though:
defaults write org.vim.MacVim ApplePressAndHoldEnabled -bool false

Nice thing about the above command is that you can still have press-and-hold enabled for other apps.

Note that you must quit the MacVim application and relaunch it. If I didn't relaunch, but only opened a new window by typing mvim in Terminal, that window doesn't have the setting applied.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

slonik-az picture slonik-az  Â·  5Comments

PLG picture PLG  Â·  4Comments

samedson picture samedson  Â·  4Comments

romainl picture romainl  Â·  5Comments

flaugher picture flaugher  Â·  4Comments