Sublime Text 2 for Zope and Plone
A few tips
I am currently trialling it, for a few reasons:
- TextMate development seems to have run aground. This smells like the classic over-ambitious "version 2" rewrite syndrome, as TextMate 2 has been promised and not materialised for years.
- Sublime Text uses Python for its plugins. I've written/tweaked a few plugins, and it's quite fun.
- Sublime Text 2 is fast, even when opening very large folders, such as a fully built-out Plone buildout directory.
- It's very keyboard-friendly, and the "goto anything" (Cmd+P) feature is really nice.
- It can natively read TextMate bundles for things like colour schemes and syntax highlighting.
- There are builds for Windows and Linux as well as OS X. I use both those operating systems at work, and a single license will work for multiple machines (i.e. it's per-user).
I won't say I'm 100% sure yet, but on balance, Sublime Text 2 (beta) feels very solid and is clearly actively developed. I've bought a license and will be using it full time for a while.
So far, there is a lot to like, though also a few things not to like:
- The sidebar/projects feature has some UI problems. I listed them here.
- The "find-in-files" feature just runs grep and displays the results as the terminal would. I much prefer Text Mate's version.
- There's no multi-file search-and-replace yet.
- The documentation is a bit patchy, but with the forums and Google, I've been able to find out must things.
I've spent a good amount of time customising and installing plugins to make it work better for me. I'll provide a run-down below, in case others are interested.
- I don't much like the default "dark" theme. Far too depressing. Luckily, there's a really nice theme called Soda. I use it with the suggested Espresso Tutti Colori colour scheme originally for TextMate and the Meslo font (11pt). You can see how these are configured here.
- I created a keyboard history plugin that works a lot like TextMate's Cmd+Shift+V/Cmd+Alt+Ctrl+V based on the code in this forum thread. You can find my version here.
- I found a really nice in-line Pyflakes checker plugin here.
- I use this plugin (originally found in the forums, sorry I've lost the link) to highlight all occurrences of the word currently under the caret, a feature I've missed from Eclipe that's useful for seeing how variables and methods are being used at-a-glance.
- I use a pretty advanced import auto-complete and jump-to-definition plugin found here (note that right now there's a problem with the current head, which will probably be fixed imminently, but see this forum thread for updates). In buildout-based projects, I use collective.recipe.omelette to generate a parts/omelette directory that can serve as a Python path, and use this script to generate a suitable config file in a local buildout (just run mkcodeintel from the root of the buildout)
- For following along a Python debugging session in Sublime Text, I'm using PdbSublimeTextSupport, a shameless ripoff of PdbTextMateSupport from Andi Zeidler and others.
- I use mr.igor quite a bit to save me having to remember import locations. This plugin makes it work in Sublime Text.
- The Zope and Buildout TextMate bundles work pretty much unchanged in Sublime Text 2 to get syntax highlighting and snippets for Zope and Buildout files. I made a few minor tweaks and uploaded them here.
- UPDATE #1: I've created build systems for running a Buildout in the project directory, running the current .cfg file as a buildout, and re-running the last used buildout with mr.developer.
- UPDATE #2: I've written a plugin for browser-like back/forward navigation as the selection is moved. See this thread.