Here are a few of my favorite Sublime Text 2 features will blow your mind if you’re new to the wonderful world of this powerful editor. If you have seen these before, consider this a handy reference. Sublime Text 2 is my favorite editor, by far. If you haven’t already, install it and take it for a test drive.
The following list of commands and descriptions cover the basic tools I use on a daily basis to make coding a breeze.
TAB: shifts selected line(s) to the right by the current tab size
SHIFT+TAB: shifts selected line(s) to the left by the current tab size (if possible)
CTRL+left or right arrow key(
OPT+left or right arrow keyon OS X): moves the cursor to the last or next word
CMD+/on OS X): toggles commenting on the current line (or selected line(s))
CMD+Ron OS X): pulls up a list of symbols in the current file (symbols could be functions in some python
CMD+Pon OS X): pulls up a list of the currently open files
CMD+D on OS X)
If you have selected a word or phrase, this shortcut adds to the current selection the next occurrence of the
selected text in the current file. That is, when starting with a segment of selected text, after pressing
CMD+D on OS X) you will now have two cursors and two selections of the same sequence of characters in your file.
You can keep pressing the shortcut to add to your current selection. This is useful when you need to change a variable
name throughout a section of your document. Simply select the first occurrence, enter the shortcut until you have
selected each phrase you want to change, then start typing the replacement text. (NOTE: If you have not selected
anything, this shortcut selects the current word.)
CMD+SHIFT+P on OS X)
This shortcut opens the command palette which quickly allows you to access anything in the Sublime Text 2 menu.
I use it to look up available snippets in the current syntax (just start typing ”
snippet”). In fact,
the fuzzy search algorithm used to match your text in the command palette means you could type ”
or any other abbreviation to filter the available commands.