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.

cloudrave commented Sep 14, 2012

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

@barmstrong

This comment has been minimized.

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.

kenmgrimm commented Nov 6, 2012

THANK YOU!!!

@styts

This comment has been minimized.

styts commented Nov 14, 2012

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

@bruceharris

This comment has been minimized.

bruceharris commented Dec 20, 2012

+1 very useful!

@lancekruegger

This comment has been minimized.

lancekruegger commented Jan 24, 2013

Yup this worked perfectly!

@jasperridge

This comment has been minimized.

jasperridge commented Feb 15, 2013

Perfect! Thanks!

@kernelp4nic

This comment has been minimized.

kernelp4nic commented Feb 19, 2013

Thanks! :)

@marcelomagf

This comment has been minimized.

marcelomagf commented Feb 27, 2013

+1 thanks!

@ethagnawl

This comment has been minimized.

ethagnawl commented Mar 19, 2013

Thanks, @kconragan!

@namklabs

This comment has been minimized.

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.

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.

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.

rwifeng commented Jun 8, 2013

perfect thx!

@philipphoffmann

This comment has been minimized.

philipphoffmann commented Jun 20, 2013

cool, thx!

@ourweakness

This comment has been minimized.

ourweakness commented Jul 21, 2013

Much Appreciated!

@chaseadamsio

This comment has been minimized.

chaseadamsio commented Jul 23, 2013

+1. Absolutely Useful.

@luisvillamarin

This comment has been minimized.

luisvillamarin commented Jul 31, 2013

Thanks!

@kzsh

This comment has been minimized.

kzsh commented Sep 11, 2013

Thank you.

@victoria-gramlich

This comment has been minimized.

victoria-gramlich commented Sep 13, 2013

Thank you! Much appreciated, worked with no problems.

@ronaldballard

This comment has been minimized.

ronaldballard commented Sep 30, 2013

Thanks.

@soharu

This comment has been minimized.

soharu commented Oct 27, 2013

Thank you! :D

@danijel

This comment has been minimized.

danijel commented Nov 5, 2013

Thanks!

@dxslly

This comment has been minimized.

dxslly commented Nov 5, 2013

Really helpful, thanks!

@uiureo

This comment has been minimized.

uiureo commented Nov 7, 2013

+1

@srigi

This comment has been minimized.

srigi commented Nov 12, 2013

Cannot make it work in Mavericks. Any ideas?

@dcmoore

This comment has been minimized.

dcmoore commented Nov 15, 2013

This is awesome! Thanks for sharing. 👏

@emwalker

This comment has been minimized.

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.

teddy1004 commented Nov 25, 2013

Thanks for sharing! This really helps me!

@hahla

This comment has been minimized.

hahla commented Dec 8, 2013

+1

@kodosaru

This comment has been minimized.

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.

michael-odell commented Jan 17, 2014

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

@thedodd

This comment has been minimized.

thedodd commented Jan 17, 2014

Solid +1

@xinxu

This comment has been minimized.

xinxu commented Jan 22, 2014

Thank you! That save me from so much pain.

@maikeldaloo

This comment has been minimized.

maikeldaloo commented Jan 29, 2014

Thanks - this was a great helper.

@pshomov

This comment has been minimized.

pshomov commented Feb 10, 2014

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

@rpond-pa

This comment has been minimized.

rpond-pa commented Mar 5, 2014

:+1 Thanks. Perfect answer.

@luigi

This comment has been minimized.

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.

davidlygagnon commented Mar 23, 2014

Awesome!

@skinp

This comment has been minimized.

skinp commented Mar 26, 2014

Finally!! Thanks!

@bahtou

This comment has been minimized.

bahtou commented Apr 4, 2014

such fantastic

@gerrywastaken

This comment has been minimized.

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.

ghost commented Jul 11, 2014

Thank you.

@tortillacrisis

This comment has been minimized.

tortillacrisis commented Aug 27, 2014

saved me - thanks.

@elvis-bi

This comment has been minimized.

elvis-bi commented Oct 9, 2014

+1 Thanks!

@ain

This comment has been minimized.

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.

Kinghack commented Nov 26, 2014

So cool!

Thanks!

@nemish

This comment has been minimized.

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.

st4lk commented Dec 17, 2014

Awesome, many thanks! 👍

@roseperrone

This comment has been minimized.

roseperrone commented Jan 7, 2015

Thank you!!

@sancel22

This comment has been minimized.

sancel22 commented Jan 13, 2015

Thanks (y)

@justinjmoses

This comment has been minimized.

justinjmoses commented Feb 5, 2015

👍

@victor-guoyu

This comment has been minimized.

victor-guoyu commented Feb 6, 2015

Thanks, saved my day!

@elegantcoder

This comment has been minimized.

elegantcoder commented Feb 17, 2015

👍

@dimiii

This comment has been minimized.

dimiii commented Feb 20, 2015

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

@awingla

This comment has been minimized.

awingla commented Feb 26, 2015

Thank you!

@medington

This comment has been minimized.

medington commented Mar 11, 2015

👍

@drajguru

This comment has been minimized.

drajguru commented Mar 17, 2015

Thanks!

@limichange

This comment has been minimized.

limichange commented Mar 18, 2015

谢谢!

@alissapajer

This comment has been minimized.

alissapajer commented Mar 20, 2015

Thanks! :)

@arya-s

This comment has been minimized.

arya-s commented Mar 27, 2015

Much appreciated

@hlu200

This comment has been minimized.

hlu200 commented Mar 27, 2015

Valuable tip!

@plutoshe

This comment has been minimized.

plutoshe commented Apr 7, 2015

Thanks a lot! It works very well!

@lnx

This comment has been minimized.

lnx commented Apr 14, 2015

Work like a charm!

@hlzz

This comment has been minimized.

hlzz commented Apr 17, 2015

fantistic!

@amalantony

This comment has been minimized.

amalantony commented May 6, 2015

Thanks!

@OmarMakled

This comment has been minimized.

OmarMakled commented May 17, 2015

Thanks

@joshjung

This comment has been minimized.

joshjung commented May 19, 2015

Damn this is perfect

@voischev

This comment has been minimized.

voischev commented May 21, 2015

Спасибо!

@taein2301

This comment has been minimized.

taein2301 commented Jun 15, 2015

wow Thanks you~

@GabeIsman

This comment has been minimized.

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.

smahi commented Jun 23, 2015

Thank you very much.

@bgenchel

This comment has been minimized.

bgenchel commented Jun 23, 2015

My hero.

@jimwhitfield

This comment has been minimized.

jimwhitfield commented Jun 24, 2015

👍

@egonina

This comment has been minimized.

egonina commented Jul 8, 2015

thanks x1000!

@ablegao

This comment has been minimized.

ablegao commented Jul 14, 2015

Thanks !

@xiaoronglv

This comment has been minimized.

xiaoronglv commented Jul 20, 2015

Thanks.

@adc-mmanfredi

This comment has been minimized.

adc-mmanfredi commented Jul 20, 2015

SWWWWEEEEEEEEET! Thank you!

@kumarabinash

This comment has been minimized.

kumarabinash commented Jul 24, 2015

Just what I was looking for! Thanks a lot!

@Sitebase

This comment has been minimized.

Sitebase commented Jul 25, 2015

Thanks!

@jonathancross

This comment has been minimized.

jonathancross commented Aug 12, 2015

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

@RathanKumar

This comment has been minimized.

RathanKumar commented Aug 18, 2015

Thanks! nice tip :)

@wwboynton

This comment has been minimized.

wwboynton commented Aug 21, 2015

Thank you! This is excellent!

@dakoo

This comment has been minimized.

dakoo commented Sep 9, 2015

You really saved my day

@varunxyz

This comment has been minimized.

varunxyz commented Sep 10, 2015

Awesome :)

@eliseumds

This comment has been minimized.

eliseumds commented Oct 6, 2015

👍 Ty!

@Rhinomcd

This comment has been minimized.

Rhinomcd commented Oct 14, 2015

Thanks!

@hstcscolor

This comment has been minimized.

hstcscolor commented Oct 23, 2015

Awesome

@SauloSilva

This comment has been minimized.

SauloSilva commented Jan 4, 2016

thx (=

@ggomesfe

This comment has been minimized.

ggomesfe commented Jan 12, 2016

Thank you very much!

@Paulo-Rogerio

This comment has been minimized.

Paulo-Rogerio commented Jan 28, 2016

Yeah, It works !!! Thank =)

@timq

This comment has been minimized.

timq commented Feb 22, 2016

Thank you!

@jallen89

This comment has been minimized.

jallen89 commented Mar 11, 2016

thanks!

@liugangnhm

This comment has been minimized.

liugangnhm commented Apr 19, 2016

it works, thanks

@rvnath

This comment has been minimized.

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.

tony-haibo-zhu commented May 11, 2016

It works , thx !!!

@borregoho

This comment has been minimized.

borregoho commented May 25, 2016

Thanks a lot! I really appreciate this tip!

@alfonsodev

This comment has been minimized.

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.

himito commented May 30, 2016

In Mac OSX 10.11.4 works perfectly !!!

Thank you very much !

@f0d4386fa83744

This comment has been minimized.

f0d4386fa83744 commented Jun 3, 2016

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

@nickjwebb

This comment has been minimized.

nickjwebb commented Aug 24, 2016

👍

@TomTangelder

This comment has been minimized.

TomTangelder commented Sep 3, 2016

Awesome. Thank You!

@bluenautilus2

This comment has been minimized.

bluenautilus2 commented Oct 20, 2016

THANK YOU i love you

@jinyuli

This comment has been minimized.

jinyuli commented Nov 22, 2016

Thanks!

@imfangli

This comment has been minimized.

imfangli commented Nov 26, 2016

Awesome!!!

@djosephsen

This comment has been minimized.

djosephsen commented Jan 4, 2017

omfg 🥇

@alexvbush

This comment has been minimized.

alexvbush commented Jan 14, 2017

thanks!

@gaojun0816

This comment has been minimized.

gaojun0816 commented Feb 6, 2017

that's really help. thanks a lot!

@meAmidos

This comment has been minimized.

meAmidos commented Apr 3, 2017

👍

@nathanin

This comment has been minimized.

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.

mbprabowo commented May 4, 2017

In macOS Sierra 10.12.4 works perfectly !!!

Thank you very much !

@naveedtariq

This comment has been minimized.

naveedtariq commented May 9, 2017

thanks (y)

@simonvomeyser

This comment has been minimized.

simonvomeyser commented May 26, 2017

Thank you for this! 👍

@flipjs

This comment has been minimized.

flipjs commented May 30, 2017

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

@kychris

This comment has been minimized.

kychris commented Jul 29, 2017

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

@zhl108

This comment has been minimized.

zhl108 commented Sep 15, 2017

god like

@amlestin

This comment has been minimized.

amlestin commented Sep 25, 2017

Still works in Sierra. Thanks!

@ganeshkondal

This comment has been minimized.

ganeshkondal commented Oct 10, 2017

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

@integrii

This comment has been minimized.

integrii commented Oct 26, 2017

Thank you!!!!!

@ishanray

This comment has been minimized.

ishanray commented Oct 28, 2017

thanks

@pawelkleczek

This comment has been minimized.

pawelkleczek commented Dec 18, 2017

thank you

@aManNamedTed

This comment has been minimized.

aManNamedTed commented Apr 26, 2018

still works! thanks so much 😁

@johnanukem

This comment has been minimized.

johnanukem commented Aug 13, 2018

Thank you! Still works

@zjiayao

This comment has been minimized.

zjiayao commented Aug 20, 2018

Worked, thanks!

@Drowze

This comment has been minimized.

Drowze commented Aug 29, 2018

Worked perfectly, cheers.

@joshuapinter

This comment has been minimized.

joshuapinter commented Oct 13, 2018

tenor

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