Oh, Sublime Text, how do I love thee?


— 12:48 AM on September 21, 2012

Let me count the ways...

Okay, so I never dreamed I'd ever spend $59 on a text editor. I mean, there are perfectly good ones out there that cost absolutely nothing. Some of them are so feature-rich they're almost operating systems unto themselves. Others are smaller, more nimble, and less reliant on arcane text commands from the days of disco and BBSes.

I've spent the past six years or so making daily use of those smaller, less intimidating editors. See, while we've got a pretty excellent content management system here at TR, the gang and I do most of our writing in plain text in our editors of choice. We can insert custom tags and images at our leisure, and we're not at the mercy of Microsoft Word's godawful rich text to HTML conversion. Besides that, I double as TR's resident web designer and CSS monkey, which involves long hours of code editing.

I started out with Scite, which served me well for... oh, probably four of those six years. Scite happily supports macros and other niceties, and it's got a pretty barebones user interface. The default syntax highlighting isn't too great, though, and I ran into limitations with the built-in regular expression support. Eventually, I felt a little constrained. I felt like I ought to find a more capable editor and stretch my wings a little.

So I tried a whole smorgasbord of editors. I tried Crimson Editor, E Text Editor, EditPlus, EmEditor, Notepad2, TextPad, UltraEdit, and many others I've now forgotten about. But none of them really thrilled me. In the end, I settled on Notepad++, which seemed to have the least obnoxious interface and a pretty good set of features. Macro support wasn't great, but I got by. The regular expression implementation was limited, but I found ways around that. Syntax highlighting was ugly, and the the program seemed to forget all my customizations every so often, but I soldiered on.

Meanwhile, on my MacBook, I found what seemed like the holy grail: TextMate. It did everything I wanted just the way I wanted, and it felt a million times more polished than Notepad++. Unfortunately, there was no Windows version. (E Text Editor sort of counts as a Windows port, but last I checked, it wasn't feature complete.)

Dispirited, I continued my search on the Windows side. Every few months, I downloaded a couple of new editors, tried them for a while, and then discarded them.

And then I found Sublime Text. Well, I'd already found it before, but in an earlier beta form that didn't do everything I needed. When I revisited the app and grabbed the new 2.0 release, I was almost immediately taken with it. Here's why:

  • It's beautiful. Style doesn't count for much in the nitty-gritty world of text editing, but if you're going to stare at a piece of software all day, an elegant user interface is definitely a plus. Sublime Text looks downright sexy compared to the competition. There are plenty of stylish themes (both built-in and third-party) to choose from, as well.

  • It has awesome automation features. I only handle HTML and CSS with any regularity, but Sublime Text has keyboard shortcuts that speed up certain operations considerably. Instead of manually typing
    <a href="http://some.website.com">some website</a>
    for hyperlinks, for instance, I simply press A, hit TAB, paste the URL, hit TAB again, enter the hyperlink text, and hit TAB again to move the cursor after the tag. Done. When writing, say, ordered lists, I can automatically close tags by hitting ALT+. or wrap selections inside new tags by hitting ALT+SHIFT+W. I already instinctively try to use those shortcuts when inputting HTML outside Sublime.
  • It has a "distraction-free" mode. Press SHIFT+F11, and the program goes full-screen, the window decorations disappear, and your text or code turns into a single, narrow column in the middle of the screen. (You can adjust the width of the column in the settings.) That's a godsend if, like me, you find that flashing IM windows and other background UI animations can curb a good writing or coding streak.

  • It supports multiple selections. By this, I mean it lets you select multiple, non-contiguous strings of text simultaneously. The main page of the Sublime Text website has some animated examples, but it's just as convenient as it sounds. The best part is that there are keyboard shortcuts to speed up the process. For example, you can add the next instance of the currently selected string to the selection by hitting CTRL+D, or you can select all instances of it by hitting ALT+F3. You can even hit CTRL+SHIFT+L to split a multi-line selection so that each line becomes a discrete selection. It's also possible to have the cursor in multiple places at once without anything being selected—so you can, for example, insert multiple instances of the same HTML tag in one go.
  • It has an apt-get-like package management system for plug-ins. No, seriously. You start by installing Package Control, which is done by entering a snippet of code in the editor's console (accessible via CTRL+`). Then, you can look up and install virtually any plug-in right there in the editor by hitting CTRL+SHIFT+P, which brings up Sublime's command palette, and typing "install package." That command will refresh the Package Control repository and show you a list of available plug-ins. To install one, simply select it and press enter. If you'd like to get rid of an installed plug-in, just bring up the command palette again and enter "remove package." You'll see a list of all-your plug-ins, and you can remove one by selecting it and hitting enter.

  • It has spell-checking built in. That's not particularly remarkable, but it's handy for someone like myself, who uses his text editor for both prose and code.
  • It has really good plug-ins. I've only got a couple of those installed right now (in addition to Package Control, of course), but they save me a ton of time. One of them allows me to select a bunch of images in a directory and automatically generate HTML image codes, complete with size attributes. The other provides a scripting system to automate search-and-replace operations that involve regular expressions. I've got that one set up so hitting ALT+SHIFT+1 automatically trims the domain name out of internal TR hyperlinks and appends our affiliate codes to Newegg and Amazon links. The macro code looks like so:
        "amazon": {
            "find": "\"http://www.amazon.com/(((?!thetecrep08-20).)+?)\"",
            "replace": "\"http://www.amazon.com/\\1?ie=UTF8&tag=thetecrep08-20\"",
            "case": false
        },
        "newegg": {
            "find": "\"http://www.newegg.com/([^\"]+?)\"",
            "replace": "\"http://www.kqzyfj.com/click-1800524-10487648?url=http://
    www.newegg.com/\\1\"",
            "case": false
        },
        "techreport": {
            "find": "\"http://techreport.com/([^\"]+?)\"",
            "replace": "\"/\\1\"",
            "case": false
        }
  • It has pretty solid regular expression support. See above. Not all text editors that claim to support regular expressions do so properly. The regular expression for the Amazon affiliate code, for example, just doesn't seem to work in Scite. Some other editors I've tried also have spotty regexp support.
  • It's totally cross-platform. I don't have to use one editor on my Mac and one editor on my PC; I can install the same one on both, and I can carry over my plug-ins, settings, macros, and so on. That's supremely convenient. There's a Linux version, too, in case I ever need to use that—and since the $59 license covers all platforms, I wouldn't need to pay another dime.

  • It's extremely customizable. You don't have to rely on plug-ins for customizations. Though Sublime Text lacks a graphical settings control panel, it has fairly well documented plain-text config files defining virtually any conceivable behavior, from the scrolling speed to the text encoding to the auto-complete delay. The default config file is literally over 300 lines long, with detailed comments explaining each individual setting.

There are probably other cool features I forgot to mention, but those are the ones that swayed me. They're the reason I paid $59 for Sublime Text. And they're the reason I don't regret my purchase.

I know some of you are going to scoff at this post. Some of you will gloat that your IDE of choice—Visual Studio or otherwise—does much more to save you time and is much better suited to sophisticated coding projects. You'll probably point out that some of the aforementioned automation features are really nothing new.

And of course, the hardcore geeks among you will feel compelled to toss in a recommendation for vim or Emacs.

I'm not gonna argue. The thing is, though, I don't want an IDE, and I'm not comfortable with old-school, command-based editors. I just want a modern, graphical editor that lets me edit prose, HTML, and CSS—and Sublime Text is head and shoulders above every other solution I've tried to date. The fact that it works on both my Mac and my PC is a big deal, too, because it means I don't have to remember different sets of behaviors for each platform.

In short, I think I've found my text editing nirvana. Maybe you'll find yours elsewhere, but I suggest at least giving Sublime Text a try. You can grab it here. The free trial never expires; it just nags you at regular intervals until you either pay up or move on. I say it's worth a shot.

   
Register
Tip: You can use the A/Z keys to walk threads.
View options

This discussion is now closed.