{"id":115,"date":"2012-03-02T21:06:15","date_gmt":"2012-03-03T05:06:15","guid":{"rendered":"http:\/\/www.lorrin.org\/blog\/?p=115"},"modified":"2012-03-16T23:24:09","modified_gmt":"2012-03-17T06:24:09","slug":"fixing-key-repeat-in-os-x-lion-and-restoring-sanity-for-vim-keybindings-on-a-per-application-basis","status":"publish","type":"post","link":"https:\/\/www.lorrin.org\/blog\/2012\/03\/02\/fixing-key-repeat-in-os-x-lion-and-restoring-sanity-for-vim-keybindings-on-a-per-application-basis\/","title":{"rendered":"Fixing key-repeat in OS X Lion (and restoring sanity for Vim keybindings) on a per-application basis"},"content":{"rendered":"<p>Starting with OS X Lion, holding down a key will bring up a menu of alternate characters rather than repeating the key. (This is a <a href=\"https:\/\/support.apple.com\/kb\/HT4896\">feature<\/a>). There are <a href=\"http:\/\/lifehacker.com\/5826055\/make-your-keyboard-keys-repeat-properly-when-held-down-in-mac-os-x-lion\">many<\/a> <a href=\"http:\/\/osxdaily.com\/2011\/08\/04\/enable-key-repeat-mac-os-x-lion\/\">tips<\/a> on how to re-enable key-repeat <em>globally<\/em>. But you can also control the behavior <em>per-application<\/em> (<a href=\"http:\/\/www.belchak.com\/2011\/07\/23\/re-enabling-key-repeat-in-osx-lion\/\">thanks<\/a>, Egor Ushakov). This is handy for e.g. IntelliJ or RubyMine, or any other app that provides Vim-style keyboard bindings. The magic commands are:<\/p>\n<pre class=\"brush:shell\">% defaults write com.jetbrains.intellij ApplePressAndHoldEnabled -bool false\r\n% defaults write com.jetbrains.rubymine ApplePressAndHoldEnabled -bool false<\/pre>\n<p>But how do you figure out what the magic identifier for your application is? Simple: <code>defaults domains<\/code> will list them all:<\/p>\n<pre class=\"brush:shell\">defaults domains | gsed -e 's\/, \/\\n\/g' | grep jetbrains\r\ncom.jetbrains.intellij\r\ncom.jetbrains.intellij.ce\r\ncom.jetbrains.rubymine\r\njetbrains.communicator.core<\/pre>\n<p>Note that in order to munge the commas into newlines for grep, gsed was required because <a href=\"http:\/\/www.lorrin.org\/blog\/2012\/03\/02\/inserting-newlines-with-sed-on-os-x\/\">OS X default sed cannot (easily) insert newlines<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Starting with OS X Lion, holding down a key will bring up a menu of alternate characters rather than repeating the key. (This is a feature). There are many tips on how to re-enable key-repeat globally. But you can also control the behavior per-application (thanks, Egor Ushakov). This is handy for e.g. IntelliJ or RubyMine, <a href='https:\/\/www.lorrin.org\/blog\/2012\/03\/02\/fixing-key-repeat-in-os-x-lion-and-restoring-sanity-for-vim-keybindings-on-a-per-application-basis\/' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[37],"tags":[39,91,38],"_links":{"self":[{"href":"https:\/\/www.lorrin.org\/blog\/wp-json\/wp\/v2\/posts\/115"}],"collection":[{"href":"https:\/\/www.lorrin.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.lorrin.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.lorrin.org\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lorrin.org\/blog\/wp-json\/wp\/v2\/comments?post=115"}],"version-history":[{"count":4,"href":"https:\/\/www.lorrin.org\/blog\/wp-json\/wp\/v2\/posts\/115\/revisions"}],"predecessor-version":[{"id":149,"href":"https:\/\/www.lorrin.org\/blog\/wp-json\/wp\/v2\/posts\/115\/revisions\/149"}],"wp:attachment":[{"href":"https:\/\/www.lorrin.org\/blog\/wp-json\/wp\/v2\/media?parent=115"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.lorrin.org\/blog\/wp-json\/wp\/v2\/categories?post=115"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.lorrin.org\/blog\/wp-json\/wp\/v2\/tags?post=115"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}