IntelliJ key repeating idea.vim
Asked Answered
Z

7

122

I just installed IntelliJ CE and IdeaVim plugin.

One small popup asked about key repeating and if I want to make it enabled. But I just clicked "no" without knowing what it is asking about clearly. But it was about the moving keys: h j k l.

I cannot hold down these keys to move my cursor continuously. I've tried to revert this setting but no luck.

Most answers are either defaults write com.jetbrains.intellij.ce ApplePressAndHoldEnabled -bool false or defaults write com.jetbrains.intellij ApplePressAndHoldEnabled -bool false, but no changes.

I am on OS X El Capitan 10.11.6 and IntelliJ IDEA CE 2016.2.4

Zischke answered 21/9, 2016 at 1:9 Comment(7)
Why go through the hassle of installing a "vim plugin" in your IDE if you don't want to take advantage of advanced Vim motions?Formerly
@Formerly what do you mean by "advanced vim motions"? am I missing something?Zischke
Holding hjkl down is exactly the same as holding the cursor keys down. If you only use hjkl there's no point installing a "vim plugin".Formerly
Possible duplicate of Intellij-idea: auto-repetition of letter keysUnipersonal
@Formerly You seem to assume Vim is only about navigating, and that OP only uses Vim for navigation.Jessejessee
if you are confused what Do you want to enable repeating keys in Mac OS X on press and hold? means it means if you hold a key if it should keep pressing it automatically for you. I always expect that behaviour and can't think of a time it's not doing that so I'd suggest pressing yes. If you are to late see answers bellow.Itinerary
Also, I think that having the navigation right in your home row is still a big improvement over having to move your hand to some random place depending on the keyboard - even if you use them rather naively...Bismuth
Z
142

it turns out that I need to type this in the mac terminal:

defaults write -g ApplePressAndHoldEnabled -bool false

This is not related with any of vim, intelliJ, etc. It seems that Mac wants to support accent characters by holding the key.

Zischke answered 27/9, 2016 at 19:40 Comment(5)
If it's still not working, you should press Command+Q to quit IntelliJ first.Gaylor
FYI I just installed IdeaVim and the popup says "You can do it manually by running defaults write -g ApplePressAndHoldEnabled 0"Administer
After months of pain and suffering, I cannot take it anymore. I had to find a way, and the above tip worked! Thank you so very much!!Estimate
@aaronpenne's comment worked, not the answer. You should make yours an answer.Vaios
@Chethan bandi's solution is best if you want this change to only apply to your IDE, not your whole systemBetsybetta
I
93

you can enable key repeating per application

for Intellij Ultimate edition

defaults write com.jetbrains.intellij ApplePressAndHoldEnabled -bool false

for Intellij community edition

defaults write com.jetbrains.intellij.ce ApplePressAndHoldEnabled -bool false

ref https://intellij-support.jetbrains.com/hc/en-us/community/posts/206845385-FYI-for-Lion-users-who-use-IdeaVIM

Ignorant answered 9/8, 2017 at 15:17 Comment(3)
This answer is proper solution since I often don't need this feature when I'm not working in IDE. But how could I find the app name for this command?Foulup
If you're using PyCharm: defaults write com.jetbrains.pycharm ApplePressAndHoldEnabled -bool falseBetsybetta
You can type defaults write com.jetbrains. in the terminal and then hit the tab to auto-complete. This gave me the following for webstorm: defaults write com.jetbrains.WebStormSpray
G
8

@aaronpenne's 2020 comment is too useful to be just a comment. His was the only suggestion that worked:

FYI I just installed IdeaVim and the popup says "You can do it manually by running defaults write -g ApplePressAndHoldEnabled 0"

Gainor answered 9/10, 2022 at 14:19 Comment(1)
This worked for me. Remember to restart the IDE after running the command for the change to take effect.Brazier
T
3

If you've already set the global value with the defaults write -g command (or JetBrains did it for you), it may be necessary to delete the global default before you can use an application-specific default as noted in this SuperUser post.

defaults delete -g ApplePressAndHoldEnabled

After I did that and set an application-specific value for RubyMine...

defaults write com.jetbrains.rubymine ApplePressAndHoldEnabled -bool true

...I could use IdeaVim in RubyMine and still use the press and hold accent dialog in all other applications.

Teplitz answered 29/1, 2022 at 16:18 Comment(1)
Thanks for this, although to get key repeat to work as I desired in RubyMine I set it to false rather than true: defaults write com.jetbrains.rubymine ApplePressAndHoldEnabled -bool false, then restarted RubyMine.Remunerate
I
1

if anyone else was confused what the message from pycharm meant, but lets read it first:

Do you want to enable repeating keys in Mac OS X on press and hold?

what it means is that if you keep pressing the same key it is as if it is pressing it many times (the expected behaviour). That is all.

I might not be a vim expert but I personally wouldn't want the keyboard to act different from what I am used to so I suggest to press yes.

If you are too late and can't fix it do what the other answers suggest e.g.

for Intellij Ultimate edition

defaults write com.jetbrains.intellij ApplePressAndHoldEnabled -bool false

for Intellij community edition

defaults write com.jetbrains.intellij.ce ApplePressAndHoldEnabled -bool false
Itinerary answered 16/6, 2021 at 21:52 Comment(0)
K
0

I found this gist for various different Jetbrains IDEs:

Credits go to this: https://gist.github.com/lsd/1e1826907ab7e49c536a

    Community Edition IntelliJ: - defaults write com.jetbrains.intellij.ce ApplePressAndHoldEnabled -bool false
    Ultimate Edition IntelliJ: defaults write com.jetbrains.intellij ApplePressAndHoldEnabled -bool false
    AppCode: defaults write com.jetbrains.AppCode ApplePressAndHoldEnabled -bool false
    PyCharm: defaults write com.jetbrains.PyCharm ApplePressAndHoldEnabled -bool false
    Android Studio: defaults write com.google.android.studio ApplePressAndHoldEnabled -bool false
    WebStorm: defaults write com.jetbrains.WebStorm ApplePressAndHoldEnabled -bool false *
    RubyMine: defaults write com.jetbrains.RubyMine ApplePressAndHoldEnabled -bool false *
Krein answered 22/5, 2023 at 1:12 Comment(0)
H
0

If this command doesn't work defaults write -g ApplePressAndHoldEnabled -bool false

Use this --> defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false

Restart the app you're using like re-open the vs code etc... and it should be working.

To enable back, set to true again and you're good to go.

Credits: https://www.youtube.com/watch?v=NVUwif3DWuU

Hornet answered 25/3 at 12:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.