Sublime Text 2 – If you haven’t tried it yet you’re missing out

January 5th, 2012

I’ve always been fairly satisfied with Programmer’s Notepad and PSPad for most of my simple projects with Ruby, Python or HTML. A few days ago browsing my G+ feeds I found Sublime Text 2. At the time of writing it’s still in beta and you can try it out for free, but the author does ask you to pay a small license fee for prolonged and constant use.

Here are a few features that I think make this editor worth of consideration:

  • Multiple selection
    Editors that allow you to select multiple different lines already exist. What’s different in ST2 is that you can “spawn” multiple cursors and operate on them simultaneously. Pressing CTRL+ALT+(up or down) you can expand the cursor to include multiple lines, pressing ESC you return to a single cursor. Also you can left click on any part of your text while pressing CTRL to spawn an additional cursor. If you get it wrong, you can always CTRL+U to undo.

  • Lightning fast file switching/opening
    By pressing CTRL+P you can open a quick window where you can type the name of the file in your project you want to open (or switch to). No more browsing long directory trees or scrolling tabs.
  • Quick menu access
    Pressing CTRL+SHIFT+P will open a window where you can quickly access menu options by typing them. This is especially useful to insert code snippets (which are available for a lot of languages) and to access formatting options (for which you might not remember the keybind).
  • Code overview
    Nothing new if you’ve been using Visual Studio, but it’s not something you usually see in a lightweight text editor. This panel gives you an overview of your current open file from above, allowing you to quickly glance at the shape of the file (which is sometimes useful to find a block of code).

  • Line switching
    So typically to move one or more lines of code up or down you would select the text, cut, paste. You can make it faster with this editor by selecting the lines you want to move (or simply place the cursor on one line) and by pressing CTRL+SHIFT+(up or down).
  • Method lookup
    Ever spent time looking for a particular method or function in your source file? CTRL+R opens a quick window where you can start typing the name of the method you’re looking for and quickly jump to it.
  • Code intel
    This requires a small plugin, but it works beautifully. It’s not really a unique feature, but not all text editors have it.
  • Code folding
    Want to collapse the code on the 1st,2nd,…,9th level of nesting? CTRL+K then CTRL+(1,2,…,9)

Also, all of the classic features that we would expect from a text editor and that we find in other editors are present.

  • Goto line number
    No more scrolling, just press CTRL+G, then type the line number and press enter.
  • Toggle comments
    Select the lines you want to comment in/out and press CTRL+/ (single line comment) or CTRL+SHIFT+/ (for block comment)
  • Regex find and replace
    You can create very complex substitutions using regular expressions from the replace panel. Matches in parentheses in the regex can be referenced with $0, $1, $2… in the replacement field.
  • Macros
    Record common steps and play them back with one key.

Did I mention that it’s available for Windows, OSX and Linux? Sublime.

1 Comment

  1. I’ve used Sublime at work but didn’t really dig into it too much. Thanks for the pro-tips!

    Comment by Dylan McDonald — January 5, 2012 @ 3:07 pm

RSS feed for comments on this post. TrackBack URI

Sorry, the comment form is closed at this time.