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!
@djosephsen
Copy link

djosephsen commented Jan 4, 2017

omfg 🥇

@alexvbush
Copy link

alexvbush commented Jan 14, 2017

thanks!

@gaojun0816
Copy link

gaojun0816 commented Feb 6, 2017

that's really help. thanks a lot!

@meAmidos
Copy link

meAmidos commented Apr 3, 2017

👍

@nathanin
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
Copy link

mbprabowo commented May 4, 2017

In macOS Sierra 10.12.4 works perfectly !!!

Thank you very much !

@naveedtariq
Copy link

naveedtariq commented May 9, 2017

thanks (y)

@simonvomeyser
Copy link

simonvomeyser commented May 26, 2017

Thank you for this! 👍

@flipjs
Copy link

flipjs commented May 30, 2017

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

@kychris
Copy link

kychris commented Jul 29, 2017

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

@zhl108
Copy link

zhl108 commented Sep 15, 2017

god like

@amlestin
Copy link

amlestin commented Sep 25, 2017

Still works in Sierra. Thanks!

@ganeshkondal
Copy link

ganeshkondal commented Oct 10, 2017

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

@integrii
Copy link

integrii commented Oct 26, 2017

Thank you!!!!!

@ishanray
Copy link

ishanray commented Oct 28, 2017

thanks

@pawelkleczek
Copy link

pawelkleczek commented Dec 18, 2017

thank you

@aManNamedTed
Copy link

aManNamedTed commented Apr 26, 2018

still works! thanks so much 😁

@anukem
Copy link

anukem commented Aug 13, 2018

Thank you! Still works

@zjiayao
Copy link

zjiayao commented Aug 20, 2018

Worked, thanks!

@Drowze
Copy link

Drowze commented Aug 29, 2018

Worked perfectly, cheers.

@joshuapinter
Copy link

joshuapinter commented Oct 13, 2018

tenor

@zqWu
Copy link

zqWu commented Dec 6, 2018

!!great

@Jeferry
Copy link

Jeferry commented May 28, 2019

+1 Thank you!It works!

@mgjo5899
Copy link

mgjo5899 commented Jan 15, 2020

Wow Thanks! Still works :)

@VuongTran21
Copy link

VuongTran21 commented May 6, 2020

Thanks, it worked for me. Btw, I wonder, will .vimrc apply for Vintage in Sublime Text 3?

@eproxus
Copy link

eproxus commented Mar 4, 2021

For anyone on the Sublime Text 4 dev version just change the version to 4:

defaults write com.sublimetext.4 ApplePressAndHoldEnabled -bool false

@sp4c38
Copy link

sp4c38 commented May 22, 2021

Only works for me if I turn off press and hold globally. Tried multiple things but couldn't get it to deactivate only for Sublime Text (macOS Big Sur 11.4).

@frankfarm
Copy link

frankfarm commented May 31, 2021

I confirm that to make this work in Sublime Text released on May 21, 2021, aka Sublime Text 4 aka Build 4107 aka ST4, the solution provided above by @eproxus works.

defaults write com.sublimetext.4 ApplePressAndHoldEnabled -bool false

@atkmh66
Copy link

atkmh66 commented Feb 18, 2022

2022 , Sublime 4 . Technique Still works !
Great tip. Thanks !

@tylermako
Copy link

tylermako commented Mar 17, 2022

Still works with Sublime 4, so happy this is a thing 💯

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