Skip to content

Instantly share code, notes, and snippets.

Embed
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!
@cloudrave

This comment has been minimized.

Copy link

commented Sep 14, 2012

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

@barmstrong

This comment has been minimized.

Copy link

commented Nov 5, 2012

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!

@kenmgrimm

This comment has been minimized.

Copy link

commented Nov 6, 2012

THANK YOU!!!

@styts

This comment has been minimized.

Copy link

commented Nov 14, 2012

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

@bruceharris

This comment has been minimized.

Copy link

commented Dec 20, 2012

+1 very useful!

@lancekruegger

This comment has been minimized.

Copy link

commented Jan 24, 2013

Yup this worked perfectly!

@jasperridge

This comment has been minimized.

Copy link

commented Feb 15, 2013

Perfect! Thanks!

@kernelp4nic

This comment has been minimized.

Copy link

commented Feb 19, 2013

Thanks! :)

@marcelomagf

This comment has been minimized.

Copy link

commented Feb 27, 2013

+1 thanks!

@ethagnawl

This comment has been minimized.

Copy link

commented Mar 19, 2013

Thanks, @kconragan!

@namklabs

This comment has been minimized.

Copy link

commented Mar 28, 2013

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

@deevus

This comment has been minimized.

Copy link

commented May 8, 2013

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

defaults write com.sublimetext.3 ApplePressAndHoldEnabled -bool false
@alancwoo-gist

This comment has been minimized.

Copy link

commented Jun 4, 2013

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

@rwifeng

This comment has been minimized.

Copy link

commented Jun 8, 2013

perfect thx!

@philipphoffmann

This comment has been minimized.

Copy link

commented Jun 20, 2013

cool, thx!

@ourweakness

This comment has been minimized.

Copy link

commented Jul 21, 2013

Much Appreciated!

@chaseadamsio

This comment has been minimized.

Copy link

commented Jul 23, 2013

+1. Absolutely Useful.

@luisvillamarin

This comment has been minimized.

Copy link

commented Jul 31, 2013

Thanks!

@kzsh

This comment has been minimized.

Copy link

commented Sep 11, 2013

Thank you.

@victoria-gramlich

This comment has been minimized.

Copy link

commented Sep 13, 2013

Thank you! Much appreciated, worked with no problems.

@ronaldballard

This comment has been minimized.

Copy link

commented Sep 30, 2013

Thanks.

@soharu

This comment has been minimized.

Copy link

commented Oct 27, 2013

Thank you! :D

@danijel

This comment has been minimized.

Copy link

commented Nov 5, 2013

Thanks!

@dxslly

This comment has been minimized.

Copy link

commented Nov 5, 2013

Really helpful, thanks!

@uiur

This comment has been minimized.

Copy link

commented Nov 7, 2013

+1

@srigi

This comment has been minimized.

Copy link

commented Nov 12, 2013

Cannot make it work in Mavericks. Any ideas?

@dcmoore

This comment has been minimized.

Copy link

commented Nov 15, 2013

This is awesome! Thanks for sharing. 👏

@emwalker

This comment has been minimized.

Copy link

commented Nov 20, 2013

+1

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

@teddy1004

This comment has been minimized.

Copy link

commented Nov 25, 2013

Thanks for sharing! This really helps me!

@hahla

This comment has been minimized.

Copy link

commented Dec 8, 2013

+1

@kodosaru

This comment has been minimized.

Copy link

commented Dec 19, 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

@michael-odell

This comment has been minimized.

Copy link

commented Jan 17, 2014

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

@thedodd

This comment has been minimized.

Copy link

commented Jan 17, 2014

Solid +1

@xinxu

This comment has been minimized.

Copy link

commented Jan 22, 2014

Thank you! That save me from so much pain.

@maikeldaloo

This comment has been minimized.

Copy link

commented Jan 29, 2014

Thanks - this was a great helper.

@pshomov

This comment has been minimized.

Copy link

commented Feb 10, 2014

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

@rpond-pa

This comment has been minimized.

Copy link

commented Mar 5, 2014

:+1 Thanks. Perfect answer.

@luigi

This comment has been minimized.

Copy link

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.

@davidlygagnon

This comment has been minimized.

Copy link

commented Mar 23, 2014

Awesome!

@skinp

This comment has been minimized.

Copy link

commented Mar 26, 2014

Finally!! Thanks!

@bahtou

This comment has been minimized.

Copy link

commented Apr 4, 2014

such fantastic

@gerrywastaken

This comment has been minimized.

Copy link

commented May 10, 2014

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

@ghost

This comment has been minimized.

Copy link

commented Jul 11, 2014

Thank you.

@tortillacrisis

This comment has been minimized.

Copy link

commented Aug 27, 2014

saved me - thanks.

@coderbiq

This comment has been minimized.

Copy link

commented Oct 9, 2014

+1 Thanks!

@ain

This comment has been minimized.

Copy link

commented Oct 17, 2014

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

defaults write com.apple.Terminal ApplePressAndHoldEnabled -bool false

and restart Terminal.

@Kinghack

This comment has been minimized.

Copy link

commented Nov 26, 2014

So cool!

Thanks!

@nemish

This comment has been minimized.

Copy link

commented Nov 30, 2014

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

@st4lk

This comment has been minimized.

Copy link

commented Dec 17, 2014

Awesome, many thanks! 👍

@roseperrone

This comment has been minimized.

Copy link

commented Jan 7, 2015

Thank you!!

@sancel22

This comment has been minimized.

Copy link

commented Jan 13, 2015

Thanks (y)

@justinjmoses

This comment has been minimized.

Copy link

commented Feb 5, 2015

👍

@victor-guoyu

This comment has been minimized.

Copy link

commented Feb 6, 2015

Thanks, saved my day!

@elegantcoder

This comment has been minimized.

Copy link

commented Feb 17, 2015

👍

@dimiii

This comment has been minimized.

Copy link

commented Feb 20, 2015

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

@awingla

This comment has been minimized.

Copy link

commented Feb 26, 2015

Thank you!

@medington

This comment has been minimized.

Copy link

commented Mar 11, 2015

👍

@drajguru

This comment has been minimized.

Copy link

commented Mar 17, 2015

Thanks!

@limichange

This comment has been minimized.

Copy link

commented Mar 18, 2015

谢谢!

@alissapajer

This comment has been minimized.

Copy link

commented Mar 20, 2015

Thanks! :)

@arya-s

This comment has been minimized.

Copy link

commented Mar 27, 2015

Much appreciated

@hlu200

This comment has been minimized.

Copy link

commented Mar 27, 2015

Valuable tip!

@plutoshe

This comment has been minimized.

Copy link

commented Apr 7, 2015

Thanks a lot! It works very well!

@lnx

This comment has been minimized.

Copy link

commented Apr 14, 2015

Work like a charm!

@hlzz

This comment has been minimized.

Copy link

commented Apr 17, 2015

fantistic!

@amalantony

This comment has been minimized.

Copy link

commented May 6, 2015

Thanks!

@OmarMakled

This comment has been minimized.

Copy link

commented May 17, 2015

Thanks

@joshjung

This comment has been minimized.

Copy link

commented May 19, 2015

Damn this is perfect

@voischev

This comment has been minimized.

Copy link

commented May 21, 2015

Спасибо!

@taein2301

This comment has been minimized.

Copy link

commented Jun 15, 2015

wow Thanks you~

@GabeIsman

This comment has been minimized.

Copy link

commented Jun 15, 2015

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

@smahi

This comment has been minimized.

Copy link

commented Jun 23, 2015

Thank you very much.

@bgenchel

This comment has been minimized.

Copy link

commented Jun 23, 2015

My hero.

@jimwhitfield

This comment has been minimized.

Copy link

commented Jun 24, 2015

👍

@egonina

This comment has been minimized.

Copy link

commented Jul 8, 2015

thanks x1000!

@ablegao

This comment has been minimized.

Copy link

commented Jul 14, 2015

Thanks !

@xiaoronglv

This comment has been minimized.

Copy link

commented Jul 20, 2015

Thanks.

@adc-mmanfredi

This comment has been minimized.

Copy link

commented Jul 20, 2015

SWWWWEEEEEEEEET! Thank you!

@kumarabinash

This comment has been minimized.

Copy link

commented Jul 24, 2015

Just what I was looking for! Thanks a lot!

@Sitebase

This comment has been minimized.

Copy link

commented Jul 25, 2015

Thanks!

@jonathancross

This comment has been minimized.

Copy link

commented Aug 12, 2015

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

@RathanKumar

This comment has been minimized.

Copy link

commented Aug 18, 2015

Thanks! nice tip :)

@wwboynton

This comment has been minimized.

Copy link

commented Aug 21, 2015

Thank you! This is excellent!

@dakoo

This comment has been minimized.

Copy link

commented Sep 9, 2015

You really saved my day

@varunxyz

This comment has been minimized.

Copy link

commented Sep 10, 2015

Awesome :)

@eliseumds

This comment has been minimized.

Copy link

commented Oct 6, 2015

👍 Ty!

@Rhinomcd

This comment has been minimized.

Copy link

commented Oct 14, 2015

Thanks!

@hstcscolor

This comment has been minimized.

Copy link

commented Oct 23, 2015

Awesome

@SauloSilva

This comment has been minimized.

Copy link

commented Jan 4, 2016

thx (=

@ggomesfe

This comment has been minimized.

Copy link

commented Jan 12, 2016

Thank you very much!

@Paulo-Rogerio

This comment has been minimized.

Copy link

commented Jan 28, 2016

Yeah, It works !!! Thank =)

@timq

This comment has been minimized.

Copy link

commented Feb 22, 2016

Thank you!

@jallen89

This comment has been minimized.

Copy link

commented Mar 11, 2016

thanks!

@liugangnhm

This comment has been minimized.

Copy link

commented Apr 19, 2016

it works, thanks

@rvnath

This comment has been minimized.

Copy link

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.

@tony-haibo-zhu

This comment has been minimized.

Copy link

commented May 11, 2016

It works , thx !!!

@borregoho

This comment has been minimized.

Copy link

commented May 25, 2016

Thanks a lot! I really appreciate this tip!

@alfonsodev

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

commented May 30, 2016

In Mac OSX 10.11.4 works perfectly !!!

Thank you very much !

@ghost

This comment has been minimized.

Copy link

commented Jun 3, 2016

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

@nickjwebb

This comment has been minimized.

Copy link

commented Aug 24, 2016

👍

@TomTangelder

This comment has been minimized.

Copy link

commented Sep 3, 2016

Awesome. Thank You!

@bluenautilus2

This comment has been minimized.

Copy link

commented Oct 20, 2016

THANK YOU i love you

@jinyuli

This comment has been minimized.

Copy link

commented Nov 22, 2016

Thanks!

@imfangli

This comment has been minimized.

Copy link

commented Nov 26, 2016

Awesome!!!

@djosephsen

This comment has been minimized.

Copy link

commented Jan 4, 2017

omfg 🥇

@alexvbush

This comment has been minimized.

Copy link

commented Jan 14, 2017

thanks!

@gaojun0816

This comment has been minimized.

Copy link

commented Feb 6, 2017

that's really help. thanks a lot!

@meAmidos

This comment has been minimized.

Copy link

commented Apr 3, 2017

👍

@nathanin

This comment has been minimized.

Copy link

commented Apr 20, 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

This comment has been minimized.

Copy link

commented May 4, 2017

In macOS Sierra 10.12.4 works perfectly !!!

Thank you very much !

@naveedtariq

This comment has been minimized.

Copy link

commented May 9, 2017

thanks (y)

@simonvomeyser

This comment has been minimized.

Copy link

commented May 26, 2017

Thank you for this! 👍

@flipjs

This comment has been minimized.

Copy link

commented May 30, 2017

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

@kychris

This comment has been minimized.

Copy link

commented Jul 29, 2017

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

@zhl108

This comment has been minimized.

Copy link

commented Sep 15, 2017

god like

@amlestin

This comment has been minimized.

Copy link

commented Sep 25, 2017

Still works in Sierra. Thanks!

@ganeshkondal

This comment has been minimized.

Copy link

commented Oct 10, 2017

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

@integrii

This comment has been minimized.

Copy link

commented Oct 26, 2017

Thank you!!!!!

@ishanray

This comment has been minimized.

Copy link

commented Oct 28, 2017

thanks

@pawelkleczek

This comment has been minimized.

Copy link

commented Dec 18, 2017

thank you

@aManNamedTed

This comment has been minimized.

Copy link

commented Apr 26, 2018

still works! thanks so much 😁

@johnanukem

This comment has been minimized.

Copy link

commented Aug 13, 2018

Thank you! Still works

@zjiayao

This comment has been minimized.

Copy link

commented Aug 20, 2018

Worked, thanks!

@Drowze

This comment has been minimized.

Copy link

commented Aug 29, 2018

Worked perfectly, cheers.

@joshuapinter

This comment has been minimized.

Copy link

commented Oct 13, 2018

tenor

@zqWu

This comment has been minimized.

Copy link

commented Dec 6, 2018

!!great

@Jeferry

This comment has been minimized.

Copy link

commented May 28, 2019

+1 Thank you!It works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.