Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Enable key repeat in Apple Lion for Sublime Text in Vim mode
# Mac OS X Lion introduced a new, iOS-like context menu when you press and hold a key
# that enables you to choose a character from a menu of options. If you are on Lion
# try it by pressing and holding down 'e' in any app that uses the default NSTextField
# for input.
# It's a nice feature and continues the blending of Mac OS X and iOS features. However,
# it's a nightmare to deal with in Sublime Text if you're running Vintage (Vim) mode,
# as it means you cannot press and hold h/j/k/l to move through your file. You have
# to repeatedly press the keys to navigate.
# You can disable this feature for just Sublime Text by issuing the following command
# in your terminal (*not* the Sublime Text console):
defaults write com.sublimetext.3 ApplePressAndHoldEnabled -bool false
# Note: replace com.sublimetext.3 with whichever version of Sublime Text you are running
# eg. 'com.sublimetext.2'
# Alternately, if you want this feature disabled globally, you can enter this:
defaults write -g ApplePressAndHoldEnabled -bool false
# In either case you'll need to restart Sublime Text for the change to take place.
# Happy coding!

Thanks! I had to restart Sublime to apply changes, but worked perfectly!

Also, worth noting: you enter this in the OS X terminal, not the sublime terminal (which was my first, incorrect, guess). Thanks for the tip!


styts commented Nov 14, 2012

Already had to use this twice. Thank you!!!!

+1 very useful!

Yup this worked perfectly!

Perfect! Thanks!

Thanks! :)

+1 thanks!

Thanks, @kconragan!

+1 awesome, but should be renamed for maximum brevity and cleverness :P

deevus commented May 8, 2013

I love you. Works in ST3 too! (with a minor change)

defaults write com.sublimetext.3 ApplePressAndHoldEnabled -bool false

Thank you, fantastic. Should note also didn't need to restart the computer, only sublime text.

rwifeng commented Jun 8, 2013

perfect thx!

cool, thx!

Much Appreciated!

+1. Absolutely Useful.


kzsh commented Sep 11, 2013

Thank you.

Thank you! Much appreciated, worked with no problems.


soharu commented Oct 27, 2013

Thank you! :D

danijel commented Nov 5, 2013


dxslly commented Nov 5, 2013

Really helpful, thanks!

uiureo commented Nov 7, 2013


srigi commented Nov 12, 2013

Cannot make it work in Mavericks. Any ideas?

dcmoore commented Nov 15, 2013

This is awesome! Thanks for sharing. 👏


An important detail here is the com.sublimetext.3 -- the documentation is outdated (and Google picks up the older v2 docs).

Thanks for sharing! This really helps me!

hahla commented Dec 8, 2013


Kai, you rock! Thanks a lot for solving one problem along the way in my quest to find the perfect editor.

Side note:

defaults write com.sublimetext.3 ApplePressAndHoldEnabled -bool false

didn't work for me after restarting Sublime, but your global command did:

defaults write -g ApplePressAndHoldEnabled -bool false

Thank you very much! Appreciate the documentation and options presented.

thedodd commented Jan 17, 2014

Solid +1

xinxu commented Jan 22, 2014

Thank you! That save me from so much pain.

Thanks - this was a great helper.

pshomov commented Feb 10, 2014

This has been bugging me for some time now, thanx a lot!

rpond-pa commented Mar 5, 2014

:+1 Thanks. Perfect answer.

luigi commented Mar 17, 2014

Any idea how to get this to work on Mavericks? The global flag works (-g) but I actually want to keep the feature for other apps.


skinp commented Mar 26, 2014

Finally!! Thanks!

bahtou commented Apr 4, 2014

such fantastic

Thank you. :) Sublime should throw up a warning about this when you activate vintage mode on OSX.


ghost commented Jul 11, 2014

Thank you.

saved me - thanks.

elvis-bi commented Oct 9, 2014

+1 Thanks!

ain commented Oct 17, 2014

If someone has the same problem on Terminal (e.g. Vim), go with

defaults write ApplePressAndHoldEnabled -bool false

and restart Terminal.

So cool!


nemish commented Nov 30, 2014

With you, guys, I always solve my problems in a couple of minutes. Thanks!

st4lk commented Dec 17, 2014

Awesome, many thanks! 👍

Thank you!!

Thanks (y)


Thanks, saved my day!


dimiii commented Feb 20, 2015

Большое спасибо!

awingla commented Feb 26, 2015

Thank you!




Thanks! :)

arya-s commented Mar 27, 2015

Much appreciated

hlu200 commented Mar 27, 2015

Valuable tip!

plutoshe commented Apr 7, 2015

Thanks a lot! It works very well!

lnx commented Apr 14, 2015

Work like a charm!

hlzz commented Apr 17, 2015




Damn this is perfect


wow Thanks you~

This is awesome, thank you. Just turned on vintage mode and was immediately infuriated. You saved me much frustration.

smahi commented Jun 23, 2015

Thank you very much.

My hero.


egonina commented Jul 8, 2015

thanks x1000!

ablegao commented Jul 14, 2015

Thanks !



Just what I was looking for! Thanks a lot!


Let's see if this works... @changetip, send $1 to @kconragan

Thanks! nice tip :)

Thank you! This is excellent!

dakoo commented Sep 9, 2015

You really saved my day

Awesome :)

👍 Ty!



thx (=

Thank you very much!

Yeah, It works !!! Thank =)

timq commented Feb 22, 2016

Thank you!


it works, thanks

rvnath commented May 10, 2016

is it possible to enable arrow keys for navigation? I can see that only alphabets can be used to traverse lines.

It works , thx !!!

Thanks a lot! I really appreciate this tip!

alfonsodev commented May 28, 2016

this doesn't seem to work anymore,
Mac OS 10.11.1 Sublime 3 build 3114

defaults read  com.sublimetext.3
    ApplePressAndHoldEnabled = 0;
    NSNavLastRootDirectory = "~/Desktop/inProgress";
    NSNavPanelExpandedSizeForSaveMode = "{712, 521}";
    NSNavPanelExpandedStateForSaveMode = 1;

himito commented May 30, 2016

In Mac OSX 10.11.4 works perfectly !!!

Thank you very much !

sebascar commented Jun 3, 2016

Works on El Capitan too! ;-) You're awesome!


Awesome. Thank You!

THANK YOU i love you

jinyuli commented Nov 22, 2016



omfg 🥇


that's really help. thanks a lot!

meAmidos commented Apr 3, 2017


Seems to have worked (10.11.5)

Side note, does this have to be run each time the computer is restarted? If so, is it safe to add the line to my .bashrc ? Thanks if anyone answers!

mbprabowo commented May 4, 2017

In macOS Sierra 10.12.4 works perfectly !!!

Thank you very much !

thanks (y)

Thank you for this! 👍

flipjs commented May 30, 2017

Yosemite here at work. This is very helpful! Thank you!

kychris commented Jul 29, 2017

Thank you so much, it works. Greatly improved my efficiency (=゚ω゚)ノ.

zhl108 commented Sep 15, 2017

god like

Still works in Sierra. Thanks!

yup !! it still works & thank you....

Thank you!!!!!


thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment