Skip to content

Instantly share code, notes, and snippets.

@ihor-lev
Last active November 1, 2024 21:53
Show Gist options
  • Save ihor-lev/120e4c822d145f690f90a3fee77e2e53 to your computer and use it in GitHub Desktop.
Save ihor-lev/120e4c822d145f690f90a3fee77e2e53 to your computer and use it in GitHub Desktop.
Fix Sublime Text Home and End key usage on Mac OSX

Sublime Text Home/End keys default functionality jumps to the beginning and end of the file.

Fix Home and End keys to move the cursor to the beginning and end of lines.

Preferences > Key Bindings - User

Adding the following to the array:

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

You can now use the following combinations:

  • Go to beginning of line: Home
  • Go to end of line: End
  • Select from cursor position to beginning of line: ⇧ + Home
  • Select from the cursor position to end of line: ⇧ + End

Fix Sublime Text Home and End key usage on Mac OSX

@lisandrosilvestrini
Copy link

Thanks!

@pnahlous
Copy link

Thanks for the fix!

@Tomatrox
Copy link

Thank you very much!

@konsumer
Copy link

konsumer commented Jun 3, 2023

image

@nicosql
Copy link

nicosql commented Jun 13, 2023

Thank you so much, I'm so glad I stuck it through with Sublime; awesome community and finally the editor itself is becoming awesome!

Odd how bare bones it is out of the box but I suppose that's subjective.

@donnellperkins
Copy link

Really appreciate this! It was very annoying having it jump all the way to the top of the file or end of the file. Glad I wasn't the only one.

@eric182
Copy link

eric182 commented Aug 3, 2023

Thank You.

@dptiwari
Copy link

dptiwari commented Oct 1, 2023

Thanks a lot! really appreciate

@raja-em
Copy link

raja-em commented Oct 20, 2023

You are my man!! love you..

@ram4279
Copy link

ram4279 commented Feb 22, 2024

God bless yall. Thank you

@yoavniran
Copy link

Thank you, thank you!

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