Some Sublime Text key combos


Like everyone and their dog, I’m switching from TextMate to Sublime Text. I’ve got to the point where muscle memory for my text editor in Quicksilver is now “su” and not “tm”, but I’m still not up-to-speed on key combos and selection in Sublime text.

Here’s the two key combos I’m trying to memorise/use right now:

⌘+⇑+A: Expand selection to tag. Really handy for html - if you have the contents of a tag already selected, it’ll expand to the parent tag, and so on and so on, until you have what you want selected.

⌘+⇑+⌥+[: Reindent. I had to set this one up, actually, but I used the “reindent” command so much in TextMate that I needed to make sure it worked in SublimeText. The relevant entry to put into your custom keybindings file is:

{ "keys": ["super+alt+shift+["], "command": "reindent"},
{ "keys": ["super+alt+shift+]"], "command": "reindent"}

This will set both ⌘+&#8657+⌥+[ and ⌘+&#8657+⌥+] to reindent lines. Don’t forget, you can’t just put more than one key combo in the keys array. If you add this to your keybindings file:

{ "keys": ["super+alt+shift+[","super+alt+shift+]"], "command": "reindent"}

You’ll need to hit ⌘+⇑+⌥+[ followed by ⌘+⇑+⌥+] to issue the reindent command.