Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
alexvanu opened this issue Sep 6, 2016 · 6 comments
Closed

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

alexvanu opened this issue Sep 6, 2016 · 6 comments

Comments

@alexvanu
Copy link

alexvanu commented Sep 6, 2016

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
@alexvanu
Copy link
Author

alexvanu commented Sep 7, 2016

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.

@jpetrie
Copy link
Contributor

jpetrie commented Sep 8, 2016

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

@alexvanu
Copy link
Author

alexvanu commented Sep 8, 2016

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

@alexvanu alexvanu closed this as completed Sep 8, 2016
@kliuless
Copy link

kliuless commented Dec 12, 2017

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.

serban added a commit to serban/dotfiles that referenced this issue Feb 3, 2020
@mkdior
Copy link

mkdior commented Apr 6, 2021

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.

Late to the party (and off-topic, sorry) but I've been having issues with scrolling around in Vim (in Iterm and Terminal) and nothing seemed to be working. I thought it was my plugins and/or vimrc settings but it ended up being this. After using:

defaults write org.vim.ITerm ApplePressAndHoldEnabled -bool false

Everything started scrolling smoothly.

@bugkill3r
Copy link

Screenshot 2021-08-24 at 4 19 22 AM

For Terminal, having this Secure Keyboard Entry checked helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants