'How can I disable `ApplePressAndHoldEnabled` for a specific application (repeat keys instead of showing an accent menu)?

I'm using IntelliJ IDEA 14.1.4 Community Edition in Mac OS Yosemite 10.10.5.

I already know about the global ApplePressAndHoldEnabled fix:

defaults write -g ApplePressAndHoldEnabled -bool false

But I want to disable it only for IntelliJ IDEA, and none of these commands work when using the "IdeaVim" plugin with Scala (With restarting IDEA):

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

Or any of the other commands listed here.

How do you disable ApplePressAndHoldEnabled for a specific application?



Solution 1:[1]

You can find the appropriate domain name by grepping the output of defaults:

defaults read | egrep -o 'com\.jetbrains\.\w+' | sort --unique

For IntelliJ Ultimate it gives me:

com.jetbrains.intellij
com.jetbrains.intellij-EAP

where the second one is for EAP builds of IntelliJ.

Solution 2:[2]

As found in this SuperUser post, it may be necessary to delete the global default before the application-specific default will be visible.

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.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Neil
Solution 2 Jim Breen