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

cloudrave commented Sep 14, 2012

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

@barmstrong

This comment has been minimized.

Copy link

barmstrong 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

kenmgrimm commented Nov 6, 2012

THANK YOU!!!

@styts

This comment has been minimized.

Copy link

styts commented Nov 14, 2012

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

@bruceharris

This comment has been minimized.

Copy link

bruceharris commented Dec 20, 2012

+1 very useful!

@lancekruegger

This comment has been minimized.

Copy link

lancekruegger commented Jan 24, 2013

Yup this worked perfectly!

@jasperridge

This comment has been minimized.

Copy link

jasperridge commented Feb 15, 2013

Perfect! Thanks!

@kernelp4nic

This comment has been minimized.

Copy link

kernelp4nic commented Feb 19, 2013

Thanks! :)

@marcelomagf

This comment has been minimized.

Copy link

marcelomagf commented Feb 27, 2013

+1 thanks!

@ethagnawl

This comment has been minimized.

Copy link

ethagnawl commented Mar 19, 2013

Thanks, @kconragan!

@namklabs

This comment has been minimized.

Copy link

namklabs 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

deevus 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

alancwoo-gist 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

rwifeng commented Jun 8, 2013

perfect thx!

@philipphoffmann

This comment has been minimized.

Copy link

philipphoffmann commented Jun 20, 2013

cool, thx!

@ourweakness

This comment has been minimized.

Copy link

ourweakness commented Jul 21, 2013

Much Appreciated!

@chaseadamsio

This comment has been minimized.

Copy link

chaseadamsio commented Jul 23, 2013

+1. Absolutely Useful.

@luisvillamarin

This comment has been minimized.

Copy link

luisvillamarin commented Jul 31, 2013

Thanks!

@kzsh

This comment has been minimized.

Copy link

kzsh commented Sep 11, 2013

Thank you.

@victoria-gramlich

This comment has been minimized.

Copy link

victoria-gramlich commented Sep 13, 2013

Thank you! Much appreciated, worked with no problems.

@ronaldballard

This comment has been minimized.

Copy link

ronaldballard commented Sep 30, 2013

Thanks.

@soharu

This comment has been minimized.

Copy link

soharu commented Oct 27, 2013

Thank you! :D

@danijel

This comment has been minimized.

Copy link

danijel commented Nov 5, 2013

Thanks!

@dxslly

This comment has been minimized.

Copy link

dxslly commented Nov 5, 2013

Really helpful, thanks!

@uiur

This comment has been minimized.

Copy link

uiur commented Nov 7, 2013

+1

@srigi

This comment has been minimized.

Copy link

srigi commented Nov 12, 2013

Cannot make it work in Mavericks. Any ideas?

@dcmoore

This comment has been minimized.

Copy link

dcmoore commented Nov 15, 2013

This is awesome! Thanks for sharing. 👏

@emwalker

This comment has been minimized.

Copy link

emwalker 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

teddy1004 commented Nov 25, 2013

Thanks for sharing! This really helps me!

@hahla

This comment has been minimized.

Copy link

hahla commented Dec 8, 2013

+1

@kodosaru

This comment has been minimized.

Copy link

kodosaru 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

michael-odell commented Jan 17, 2014

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

@thedodd

This comment has been minimized.

Copy link

thedodd commented Jan 17, 2014

Solid +1

@xinxu

This comment has been minimized.

Copy link

xinxu commented Jan 22, 2014

Thank you! That save me from so much pain.

@maikeldaloo

This comment has been minimized.

Copy link

maikeldaloo commented Jan 29, 2014

Thanks - this was a great helper.

@pshomov

This comment has been minimized.

Copy link

pshomov 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

rpond-pa commented Mar 5, 2014

:+1 Thanks. Perfect answer.

@luigi

This comment has been minimized.

Copy link

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.

@davidlygagnon

This comment has been minimized.

Copy link

davidlygagnon commented Mar 23, 2014

Awesome!

@skinp

This comment has been minimized.

Copy link

skinp commented Mar 26, 2014

Finally!! Thanks!

@bahtou

This comment has been minimized.

Copy link

bahtou commented Apr 4, 2014

such fantastic

@gerrywastaken

This comment has been minimized.

Copy link

gerrywastaken 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

ghost commented Jul 11, 2014

Thank you.

@tortillacrisis

This comment has been minimized.

Copy link

tortillacrisis commented Aug 27, 2014

saved me - thanks.

@coderbiq

This comment has been minimized.

Copy link

coderbiq commented Oct 9, 2014

+1 Thanks!

@ain

This comment has been minimized.

Copy link

ain 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

Kinghack commented Nov 26, 2014

So cool!

Thanks!

@nemish

This comment has been minimized.

Copy link

nemish 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

st4lk commented Dec 17, 2014

Awesome, many thanks! 👍

@roseperrone

This comment has been minimized.

Copy link

roseperrone commented Jan 7, 2015

Thank you!!

@sancel22

This comment has been minimized.

Copy link

sancel22 commented Jan 13, 2015

Thanks (y)

@justinjmoses

This comment has been minimized.

Copy link

justinjmoses commented Feb 5, 2015

👍

@victor-guoyu

This comment has been minimized.

Copy link

victor-guoyu commented Feb 6, 2015

Thanks, saved my day!

@elegantcoder

This comment has been minimized.

Copy link

elegantcoder commented Feb 17, 2015

👍

@dimiii

This comment has been minimized.

Copy link

dimiii commented Feb 20, 2015

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

@awingla

This comment has been minimized.

Copy link

awingla commented Feb 26, 2015

Thank you!

@medington

This comment has been minimized.

Copy link

medington commented Mar 11, 2015

👍

@drajguru

This comment has been minimized.

Copy link

drajguru commented Mar 17, 2015

Thanks!

@limichange

This comment has been minimized.

Copy link

limichange commented Mar 18, 2015

谢谢!

@alissapajer

This comment has been minimized.

Copy link

alissapajer commented Mar 20, 2015

Thanks! :)

@arya-s

This comment has been minimized.

Copy link

arya-s commented Mar 27, 2015

Much appreciated

@hlu200

This comment has been minimized.

Copy link

hlu200 commented Mar 27, 2015

Valuable tip!

@plutoshe

This comment has been minimized.

Copy link

plutoshe commented Apr 7, 2015

Thanks a lot! It works very well!

@lnx

This comment has been minimized.

Copy link

lnx commented Apr 14, 2015

Work like a charm!

@hlzz

This comment has been minimized.

Copy link

hlzz commented Apr 17, 2015

fantistic!

@amalantony

This comment has been minimized.

Copy link

amalantony commented May 6, 2015

Thanks!

@OmarMakled

This comment has been minimized.

Copy link

OmarMakled commented May 17, 2015

Thanks

@joshjung

This comment has been minimized.

Copy link

joshjung commented May 19, 2015

Damn this is perfect

@voischev

This comment has been minimized.

Copy link

voischev commented May 21, 2015

Спасибо!

@taein2301

This comment has been minimized.

Copy link

taein2301 commented Jun 15, 2015

wow Thanks you~

@GabeIsman

This comment has been minimized.

Copy link

GabeIsman 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

smahi commented Jun 23, 2015

Thank you very much.

@bgenchel

This comment has been minimized.

Copy link

bgenchel commented Jun 23, 2015

My hero.

@jimwhitfield

This comment has been minimized.

Copy link

jimwhitfield commented Jun 24, 2015

👍

@egonina

This comment has been minimized.

Copy link

egonina commented Jul 8, 2015

thanks x1000!

@ablegao

This comment has been minimized.

Copy link

ablegao commented Jul 14, 2015

Thanks !

@xiaoronglv

This comment has been minimized.

Copy link

xiaoronglv commented Jul 20, 2015

Thanks.

@adc-mmanfredi

This comment has been minimized.

Copy link

adc-mmanfredi commented Jul 20, 2015

SWWWWEEEEEEEEET! Thank you!

@kumarabinash

This comment has been minimized.

Copy link

kumarabinash commented Jul 24, 2015

Just what I was looking for! Thanks a lot!

@Sitebase

This comment has been minimized.

Copy link

Sitebase commented Jul 25, 2015

Thanks!

@jonathancross

This comment has been minimized.

Copy link

jonathancross commented Aug 12, 2015

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

@RathanKumar

This comment has been minimized.

Copy link

RathanKumar commented Aug 18, 2015

Thanks! nice tip :)

@wwboynton

This comment has been minimized.

Copy link

wwboynton commented Aug 21, 2015

Thank you! This is excellent!

@dakoo

This comment has been minimized.

Copy link

dakoo commented Sep 9, 2015

You really saved my day

@varunxyz

This comment has been minimized.

Copy link

varunxyz commented Sep 10, 2015

Awesome :)

@eliseumds

This comment has been minimized.

Copy link

eliseumds commented Oct 6, 2015

👍 Ty!

@Rhinomcd

This comment has been minimized.

Copy link

Rhinomcd commented Oct 14, 2015

Thanks!

@hstcscolor

This comment has been minimized.

Copy link

hstcscolor commented Oct 23, 2015

Awesome

@SauloSilva

This comment has been minimized.

Copy link

SauloSilva commented Jan 4, 2016

thx (=

@ggomesfe

This comment has been minimized.

Copy link

ggomesfe commented Jan 12, 2016

Thank you very much!

@Paulo-Rogerio

This comment has been minimized.

Copy link

Paulo-Rogerio commented Jan 28, 2016

Yeah, It works !!! Thank =)

@timq

This comment has been minimized.

Copy link

timq commented Feb 22, 2016

Thank you!

@jallen89

This comment has been minimized.

Copy link

jallen89 commented Mar 11, 2016

thanks!

@liugangnhm

This comment has been minimized.

Copy link

liugangnhm commented Apr 19, 2016

it works, thanks

@rvnath

This comment has been minimized.

Copy link

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.

@tony-haibo-zhu

This comment has been minimized.

Copy link

tony-haibo-zhu commented May 11, 2016

It works , thx !!!

@borregoho

This comment has been minimized.

Copy link

borregoho commented May 25, 2016

Thanks a lot! I really appreciate this tip!

@alfonsodev

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

himito commented May 30, 2016

In Mac OSX 10.11.4 works perfectly !!!

Thank you very much !

@ghost

This comment has been minimized.

Copy link

ghost commented Jun 3, 2016

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

@nickjwebb

This comment has been minimized.

Copy link

nickjwebb commented Aug 24, 2016

👍

@TomTangelder

This comment has been minimized.

Copy link

TomTangelder commented Sep 3, 2016

Awesome. Thank You!

@bluenautilus2

This comment has been minimized.

Copy link

bluenautilus2 commented Oct 20, 2016

THANK YOU i love you

@jinyuli

This comment has been minimized.

Copy link

jinyuli commented Nov 22, 2016

Thanks!

@imfangli

This comment has been minimized.

Copy link

imfangli commented Nov 26, 2016

Awesome!!!

@djosephsen

This comment has been minimized.

Copy link

djosephsen commented Jan 4, 2017

omfg 🥇

@alexvbush

This comment has been minimized.

Copy link

alexvbush commented Jan 14, 2017

thanks!

@gaojun0816

This comment has been minimized.

Copy link

gaojun0816 commented Feb 6, 2017

that's really help. thanks a lot!

@meAmidos

This comment has been minimized.

Copy link

meAmidos commented Apr 3, 2017

👍

@nathanin

This comment has been minimized.

Copy link

nathanin 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

mbprabowo commented May 4, 2017

In macOS Sierra 10.12.4 works perfectly !!!

Thank you very much !

@naveedtariq

This comment has been minimized.

Copy link

naveedtariq commented May 9, 2017

thanks (y)

@simonvomeyser

This comment has been minimized.

Copy link

simonvomeyser commented May 26, 2017

Thank you for this! 👍

@flipjs

This comment has been minimized.

Copy link

flipjs commented May 30, 2017

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

@kychris

This comment has been minimized.

Copy link

kychris commented Jul 29, 2017

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

@zhl108

This comment has been minimized.

Copy link

zhl108 commented Sep 15, 2017

god like

@amlestin

This comment has been minimized.

Copy link

amlestin commented Sep 25, 2017

Still works in Sierra. Thanks!

@ganeshkondal

This comment has been minimized.

Copy link

ganeshkondal commented Oct 10, 2017

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

@integrii

This comment has been minimized.

Copy link

integrii commented Oct 26, 2017

Thank you!!!!!

@ishanray

This comment has been minimized.

Copy link

ishanray commented Oct 28, 2017

thanks

@pawelkleczek

This comment has been minimized.

Copy link

pawelkleczek commented Dec 18, 2017

thank you

@aManNamedTed

This comment has been minimized.

Copy link

aManNamedTed commented Apr 26, 2018

still works! thanks so much 😁

@johnanukem

This comment has been minimized.

Copy link

johnanukem commented Aug 13, 2018

Thank you! Still works

@zjiayao

This comment has been minimized.

Copy link

zjiayao commented Aug 20, 2018

Worked, thanks!

@Drowze

This comment has been minimized.

Copy link

Drowze commented Aug 29, 2018

Worked perfectly, cheers.

@joshuapinter

This comment has been minimized.

Copy link

joshuapinter commented Oct 13, 2018

tenor

@zqWu

This comment has been minimized.

Copy link

zqWu commented Dec 6, 2018

!!great

@Jeferry

This comment has been minimized.

Copy link

Jeferry 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.