Sublime Text is a sophisticated text editor for code, markup and prose.
I have been a long time Vim user, and always resisted the temptation to jump on the IDE bandwagon. Admittedly, I am a dinosaur, but it is not because of this, that I had stayed faithful to Vim just until recently. It happened so, because Vim was doing things the way I needed, and every time I tested a potential new editor to switch to, I realized that something was missing that I used to depend on in Vim.
So... last Christmas I started to think about what I would like to get from myself as a present, and I thought that a new editor would be nice. I started to test Sublime Text 2, and, surprise: I found it a very satisfactory experience.
I have a few editor features that I consider as basic. Naturally, I have my own point of view: since I am doing web application development with Python and JavaScript, some things such as tab settings or linting can be more important for me than for programmers in other languages, while for the same reason I don't care much about features related to, say, compiling.
So let's see my first experiences with Sublime! I installed it, and started to add and configure all the plugins I need for my workflow.
Syntax coloring, correct tabbing with 4 soft spaces
This is what I consider the basics, which means that if an editor does not know this, I would exclude it without looking for anything more. Fortunately, most good editors do this correctly, including the ability to understand the syntax of the given programming language, as it affects auto-indentation.
Live, "as you type" syntax checking. linting.
Since I had this working in Vim, and because it is really important to see live errors and warnings as you type, especially in JavaScript, where an excess comma can simply break all your code, I made this as a basic requirement in my search. And, this works well in Sublime.
Actually, it works better for me in Sublime then on Vim. I succeeded to set this up working on Vim, but since I did not follow best practices for installation and do updates rigorously, I ended up with something that was working, but never exactly matched any of my team members version. Sublime solves this problem with its package installation system.
Editable configuration files
This is a great one. The configuration files are editable in JSON format and they are updated in sync with the changes you make through interacting with the editor UI. For example, if you zoom in and out, and if the preferences are open, you can see the text of the configuration file updated live.
Supports Vim keystrokes
It knows Vim keystrokes! All you have to do is enable the Vintage module in the configuration. No more excuse for Vim users, you cannot say "...but ...but I could do this much easier in Vim."
Git support
Git support works through plugins, and it works well, although I would love to see a more powerful way of presenting diffs, similarly to VimDiff where you can see the two versions side by side.
Multiple cursors and selection
This is simply awesome. It is easier to show it than to explain it:
Code Intel
Sublime can know where your modules are at, and you can click on a symbol any time to look up its definition. This is done by the SublimeCodeIntel plugin. For python code in a buildout, this means that Sublime will know all your package location, be it a core Python library module, or a locally installed package under "src" or "eggs". For buildout, I use the following section to generate the information that Sublime needs:
[codeintel]
recipe = corneti.recipes.codeintel
eggs = ${instance:eggs}
Debugging Python
Python applications are debugged with pdb from a console. When I am at a breakpoint, and do a listing of the code, or step up and down the trace stack, Sublime will open the source and place the cursor Very useful. The only thing I did to install the PdbSublimeTextSupport python package, and save the following as a .pdbrc file:
from PdbSublimeTextSupport import preloop, precmd
pdb.Pdb.preloop = preloop
pdb.Pdb.precmd = precmd
Autosave! Autosave!
I leave this to the end. I know that it is also possible in Vim, but for some reason I have never used it. Sublime makes autosave very tempting. When you click away from the file you are editing, it will be saved. I was worried a bit that autosave can lead to accidental loss of code. But then I convinced myself, that the ability to undo, coupled with the fact that I version manage my code anyway, compensates the risk. The result? I type in my code, then I click the Reload button on my browser... and, I can see the updated version immediately! I hope must not say how much this increases my work productivity.
Problems?
Not much, really. I find a few places where I would welcome to see improved support. For example, easier management of color schemes would be great. But altogether, Sublime Text 2 provides me with a great development experience.
Getting help
There are plenty of documentation on the web that explains how to configure Sublime and its plugins. I found the blog post of Mikko Ohtamaa especially useful.
Price
Finally, a word about pricing. Sublime is not free software. A single user license for Sublime Text 2 costs $70. But Sublime can be downloaded and trialed for free. Unlike other software, that lock themselves down at the end of the trial period, and perhaps at the worst and most unexpected moment, Sublime will instead periodically pop up a discreet message to you, but you will be able to continue to use the software. I immediately rewarded this user friendly behavior by buying Sublime's license.
Verdict
Sublime Text 2 is a programmer editor that is stable, and provides most needed editor features on a high level. At the same time, it remains easily hackable, thus connecting the useful with the pleasant. It is worth to give it a try. And, if you are a Vim user, you will find the switch to Sublime extra comfortable.