Sublime Text 2 – OSX end of line key preference

May 2012

When I upgraded Sublime Text 2 after installing OSX Lion I couldn’t figure out the shortcut key to get to the beginning of a line or the end of a line which was frustrating. Luckily Sublime let’s us modify everything we want.

Here is a JSON snippet to add to Sublime.
Open your file menu at: Sublime text 2/Preferences/key bindings – default

And use this:
{ "keys": ["shift+left"], "command": "move_to", "args": {"to": "bol", "extend": true} },
{ "keys": ["shift+right"], "command": "move_to", "args": {"to": "eol", "extend": true} },

{ "keys": ["alt+left"], "command": "move_to", "args": {"to": "bol", "extend": false} },
{ "keys": ["alt+right"], "command": "move_to", "args": {"to": "eol", "extend": false} },

This will allow alt+left to place the cursor at the beginning of the line and shift+left to select the line from the current cursor placement.

Have fun coding!