Skip to content

Instantly share code, notes, and snippets.

@coldnebo
Created February 3, 2012 16:21
Show Gist options
  • Select an option

  • Save coldnebo/1730936 to your computer and use it in GitHub Desktop.

Select an option

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

mnme commented Mar 25, 2013

Copy link
Copy Markdown

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
Copy Markdown

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
Copy Markdown

Thank you, pressed it several times to celebrate.

@waylonrobert

Copy link
Copy Markdown

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

@demisx

demisx commented Sep 18, 2013

Copy link
Copy Markdown

Very nice! The life is a joy again.

ghost commented Jan 14, 2014

Copy link
Copy Markdown

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

@YA2O

YA2O commented Apr 10, 2014

Copy link
Copy Markdown

+1 you made my day

@damurdock

Copy link
Copy Markdown

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

@kingwrcy

Copy link
Copy Markdown

nice,huge thanks.

@adarhef

adarhef commented Jul 24, 2014

Copy link
Copy Markdown

Thanks, it's been driving me crazy.

@rodmhgl

rodmhgl commented Sep 8, 2014

Copy link
Copy Markdown

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

@gcamargo1

Copy link
Copy Markdown

Thanks!!

@bicepjai

Copy link
Copy Markdown

i believe in GOD now !

@jessegilbride

Copy link
Copy Markdown

much thanks.

@jeffwindsor

Copy link
Copy Markdown

many many thanks, this a great frustration relief.

@Krellan

Krellan commented Oct 5, 2015

Copy link
Copy Markdown

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

ghost commented Oct 16, 2015

Copy link
Copy Markdown

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

@GrayedFox

Copy link
Copy Markdown

Thank. God. Cheers!

@IstoraMandiri

Copy link
Copy Markdown

This has made my day.

@cdsaenz

cdsaenz commented Feb 10, 2016

Copy link
Copy Markdown

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
Copy Markdown

Oh thank you so much.

@jebees

jebees commented Mar 10, 2016

Copy link
Copy Markdown

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

@hzxie

hzxie commented Mar 22, 2016

Copy link
Copy Markdown

It works. Thanks a lot!

@raveren

raveren commented Apr 27, 2016

Copy link
Copy Markdown

@kellan, godly

@ everyone else: you need this comment.

@victor-ono

Copy link
Copy Markdown

Incredible.

@doomsbuster

Copy link
Copy Markdown

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

@racl101

racl101 commented May 18, 2016

Copy link
Copy Markdown

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

@valdean

valdean commented May 20, 2016

Copy link
Copy Markdown

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

@jthomp

jthomp commented Jun 3, 2016

Copy link
Copy Markdown

Exactly what I was looking for. Thanks!

@mikedowd

Copy link
Copy Markdown

Yes! Thanks!

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