Blog

Moving from E-TextEditor to Sublime Text 2

August 5, 2011

I’ve been using E-TextEditor for more than a year now for doing all my JavaScript, Node.js and CoffeeScript development. You can think of E-TextEditor as TextMate for the Windows platform. I’ve been pretty happy with it throughout this period as it can be extended pretty easily with a whole slew of bundles that are already available for TextMate. E-TextEditor requires you to install Cygwin which happens automatically during installation. Using the Cygwin command-line gave me enough (re-)exposure to a Linux-like environment in order for me wanting to (re-)learn about this other platform. More on that in later blog posts. Although there haven’t been any new versions of E-TextEditor for quite some time now, the current version enabled me to write JavaScript code in a productive way.

Only recently I found out about another editor called Sublime Text 2 (thanks to Ivan Porto Carrero). I downloaded this text editor in order to give it a try and I must say that I haven’t opened E-TextEditor ever since. This second version of Sublime Text is still in development but it’s pretty stable as I haven’t run into any issues so far. The cool part is that this editor is available for both Windows, Linux and OS X which enabled me to move all my Node.js and CoffeeScript development from Cygwin on Windows to Ubuntu Linux. 

CoffeeScript isn’t supported out-of-the-box (yet), so I installed the CoffeeScript  TextMate bundle written by Jeremy Ashkenas (yes, the same one from the CoffeeScript and Backbone.js fame). Also check out this page on the CoffeeScript wiki for more information on how to bring some CoffeeScript happiness to your own favorite text editor.

Setting up this TextMate bundle for use with Sublime Text 2 was actually pretty easy. Just navigate to /home//.config/sublime-text-2/Packages in a terminal (or the corresponding file path on Windows) and clone the source of the CoffeeScript TextMate bundle using git:

git clone git://github.com/jashkenas/coffee-script-tmbundle CoffeeScript

Next close all the .coffee files and restart Sublime Text 2. Now we have some nice syntax highlighting and some useful code snippets at our disposal. 

image

It's also possible to hook into the build system of Sublime Text 2. You just need to create a new file named CoffeeScript.sublime-build at the following location:

/home//.config/sublime-text-2/Packages/User 

You can add the following to this new file for compiling CoffeeScript

or the following for executing/running CoffeeScript code.
{
     "cmd": ["coffee", "-c", "$file"],
     "selector" : "source.coffee",
     "path" : "/usr/local/bin"
}

Now when you hit F7, this fresh build command is executed when a CoffeeScript source file is showing in the active tab. It’s also possible to change the build short-key to your own taste through the Preferences menu. 

Unfortunately, there’s only one build command as I would love to create a separate command for compiling and running CoffeeScript code (or perhaps I missed this feature during the excitement).

Some more usage is definitely needed for me to learn more about this excellent text editor, but currently I’m pretty happy with it. I also need to find out how well JavaScript is supported and perhaps see how far one can go when doing some C# development using Mono. I expect that there are a good number of productive features in there for me to discover.

I encourage you have a decent look at this excellent tool.

Until next time.

If you and your team want to learn more about how to write maintainable unit tests and get the most out of TDD practices, make sure to have look at our trainings and workshops or check out the books section. Feel free to reach out at infonull@nullprincipal-itnull.be.

Profile picture of Jan Van Ryswyck

Jan Van Ryswyck

Thank you for visiting my blog. I’m a professional software developer since Y2K. A blogger since Y2K+5. Provider of training and coaching in XP practices. Curator of the Awesome Talks list. Past organizer of the European Virtual ALT.NET meetings. Thinking and learning about all kinds of technologies since forever.

Comments

About

Thank you for visiting my website. I’m a professional software developer since Y2K. A blogger since Y2K+5. Author of Writing Maintainable Unit Tests. Provider of training and coaching in XP practices. Curator of the Awesome Talks list. Thinking and learning about all kinds of technologies since forever.

Contact information

(+32) 496 38 00 82

infonull@nullprincipal-itnull.be