Skip to content

Instantly share code, notes, and snippets.

@coldnebo
Created February 3, 2012 16:21
Show Gist options
  • Star 83 You must be signed in to star a gist
  • Fork 8 You must be signed in to fork a gist
  • Save coldnebo/1730936 to your computer and use it in GitHub Desktop.
Save coldnebo/1730936 to your computer and use it in GitHub Desktop.
Sublime Text 2 fix for OSX home/end keys
{ "keys": ["home"], "command": "move_to", "args": {"to": "bol"} },
{ "keys": ["end"], "command": "move_to", "args": {"to": "eol"} }
@mnme
Copy link

mnme commented Mar 25, 2013

very nice, also looseroots for the selection thingy

I added also support for the command key: https://gist.github.com/mnme/5235936

@Scotchester
Copy link

If you'd like to add support for using Cmd+ to go to the beginning/end of the file, it's pretty easy! Just add these lines:

{ "keys": ["super+home"], "command": "move_to", "args": {"to": "bof"} },
{ "keys": ["super+end"], "command": "move_to", "args": {"to": "eof"} },
{ "keys": ["super+shift+home"], "command": "move_to", "args": {"to": "bof", "extend": true} },
{ "keys": ["super+shift+end"], "command": "move_to", "args": {"to": "eof", "extend": true} }

@djonatanb
Copy link

Thank you, pressed it several times to celebrate.

@waylonrobert
Copy link

Amazing - always frustrated me how "Home/End" keys didn't work properly in OS X.

@demisx
Copy link

demisx commented Sep 18, 2013

Very nice! The life is a joy again.

Copy link

ghost commented Jan 14, 2014

Thanks for this! Just an FYI - this works totally fine in Sublime Text 3 on OSX!

@YA2O
Copy link

YA2O commented Apr 10, 2014

+1 you made my day

@damurdock
Copy link

Kind of late, but thank you for this! It still works in Sublime Text 3 too!

@kingwrcy
Copy link

nice,huge thanks.

@adarhef
Copy link

adarhef commented Jul 24, 2014

Thanks, it's been driving me crazy.

@rodmhgl
Copy link

rodmhgl commented Sep 8, 2014

And just like that, I was 50% more productive. Thanks!

@gcamargo1
Copy link

Thanks!!

@bicepjai
Copy link

i believe in GOD now !

@jessegilbride
Copy link

much thanks.

@jeffwindsor
Copy link

many many thanks, this a great frustration relief.

@Krellan
Copy link

Krellan commented Oct 5, 2015

Wow, great! This is the #1 hit on Google for "sublime text home end", for good reason. These tips have unfscked my Home and End keys! Much appreciation.

Here's all of the suggested edits on this page so far, all edited together, for your convenience:

[
 { "keys": ["home"],             "command": "move_to", "args": {"to": "bol"                 } },
 { "keys": ["end"],              "command": "move_to", "args": {"to": "eol"                 } },
 { "keys": ["shift+home"],       "command": "move_to", "args": {"to": "bol", "extend": true } }, 
 { "keys": ["shift+end"],        "command": "move_to", "args": {"to": "eol", "extend": true } },
 { "keys": ["super+home"],       "command": "move_to", "args": {"to": "bof"                 } },
 { "keys": ["super+end"],        "command": "move_to", "args": {"to": "eof"                 } },
 { "keys": ["super+shift+home"], "command": "move_to", "args": {"to": "bof", "extend": true } },
 { "keys": ["super+shift+end"],  "command": "move_to", "args": {"to": "eof", "extend": true } }
]

Whitespace added for readability. Simply cut and paste into your keymap file (Sublime Text 2 / Preferences / Key Bindings - User). Takes effect immediately, as soon as that file is saved!

Josh

Copy link

ghost commented Oct 16, 2015

You da man Josh! And kudos OP's for this life-enhancement.

@GrayedFox
Copy link

Thank. God. Cheers!

@IstoraMandiri
Copy link

This has made my day.

@cdsaenz
Copy link

cdsaenz commented Feb 10, 2016

A life saver, thanks guys, I'm moving from Windows to OSX and this was driving me insane in every editor, I might actually decide to buy Sublime after this great fix. Thanks a lot everyone.

@dustinevan
Copy link

Oh thank you so much.

@jebees
Copy link

jebees commented Mar 10, 2016

for the love of all that is holy, THIS IS WONDERFUL. Thank you Krellan!!

@hzxie
Copy link

hzxie commented Mar 22, 2016

It works. Thanks a lot!

@raveren
Copy link

raveren commented Apr 27, 2016

@kellan, godly

@ everyone else: you need this comment.

@victor-ono
Copy link

Incredible.

@doomsbuster
Copy link

@Dayjo Thank you very much. This saves the day.

@racl101
Copy link

racl101 commented May 18, 2016

Wunderbar! Thanks for sharing this guys. This makes me happy.

@valdean
Copy link

valdean commented May 20, 2016

@coldnebo @Dayjo @Krellan @raveren thank you for all of the comments above. all helpful. this had been driving me crazy.

@jthomp
Copy link

jthomp commented Jun 3, 2016

Exactly what I was looking for. Thanks!

@mikedowd
Copy link

Yes! Thanks!

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