Here is a screencast with a tutorial on creating your own bundles in e. It uses the todo.txt format as example, which is a simple plain text todo list format created by Gina Trapani, and shows how to add highlighting, commands, completions and snippets.

Creating your own bundles is quite easy in e. The documentation on this is still very limited, but the original documentation on the TextMate bundles format all apply (we just use JSON rather than the apple plist format to define Languages and Preferences).

The resulting bundle has been put on ebundles and can be installed from the bundle manager.

Snippet Pipes

September 16th, 2008

The latest update adds an extension to the snippet format, so that you can pipe the contents of individual tabstops through shell commands. This makes it possble for snippets to be far more interactive.

The syntax is pretty straightforward. Here is a simple example that allows you to directly evaluate ruby code:

 ${1:ruby code|ruby -e "print eval STDIN.read"}

If this snippet is bound to the tabtrigger “ru”, then pressing ru[TAB]1+2[TAB] will result in 3 (without leaving any trace of the intermediate steps). Very handy for doing quick calculations without having to do a mental shift and since you have access to the full language you can do far more than simple arithmetic.

The equivalent snippet for python would be:

${1:python code|python -c "import sys; print eval(sys.stdin.read())"}

The commands are not limited to just reading from stdin. They have access to all the standard environment variables, plus a few snippet specific ones:

  • TM_SNIPPET : contains the entire snippet
  • TM_TABSTOP_n: contains the contents of the individual tabstops

This means that you can make snippets that react on quite complex input from the user. Here is a simple example of a snippet that draws a box in a user defined size:

${0:Draw box ${1:10} times ${2:10}|"$TM_BUNDLE_SUPPORT/starbox.rb"}

It works with the following script placed in the bundles support dir:

#!/usr/bin/env ruby

width = ENV['TM_TABSTOP_1'].to_i
height = ENV['TM_TABSTOP_2'].to_i

height.times do
  width.times {print “*”}
  print “\n”
end

The content is piped to the command at the moment you tab out of a tabstop. The one exception is tabstop zero (the ender tabstop). Since this completes the snippet, the piping happens on entry. In the above snippet, this is used to replace the entire snippet text with the user defined box.

This extension of the syntax is currently specific for e. But if it sees enough use then we can hope that it becomes supported in TextMate as well.

Since publishing the Regular Expression Tutorial, I have received a lot of request for making the accompanying cheatsheet available in a more tangible form. So here it is on mugs and mousepads:

Rss feed to track e updates

March 7th, 2008

The release cycle for e is pretty fast, with new updates coming out every one or two weeks. All updates are announced on the forum, but if you are not a regular there, it can still be hard to keep track.

To help on this situation, user Charles Roper has made an rss feed tracking the e updates:

http://feed43.com/e-texteditor-releases.xml

Add it to your feed reader and you will get automatically notified when new updates are released.

Remote Projects

February 14th, 2008

The latest updates of e has added support for remote projects. This means that you can open an ftp site directly in the project pane and use it as if it was a local project.

Working with Remote Project

In earlier versions of e, this could also be approximated with various shell plug-ins, but having it as an integrated part of e removes the reliance on external tools and gives a much nicer user experience. Implementing this features was also an opportunity to re-architect and improve a part of e that had gone a bit stale while the rest of the editor had evolved. The new underlying project framework is very flexible and extensible, and will allow for a lot of new capabilities in the near future.

Opening a remote project

To open a remote project just select ‘File/Open Remote Folder’ on the menu, create a new profile and press ‘Open’. The remote site will be opened in the project pane, and you can interact with it as if it was a local project.

Editing profile for remote project

You can also open remote files and projects directly from the command line. You just have to give it the path i url format:

e.exe ftp://ftp.mydomain.com/dir/file.txt
e.exe ftp://ftp.mydomain.com/dir/ (remember trailing slash for projects)
e.exe ftp://username:password@ftp.mydomain.com/dir/ (with login)

The remote projects feature is still very new and currently only supports the ftp, but support for protocols like sftp and webdav will be available soon.

e text editor screenshot

After a long beta period, e is finally coming out of beta. It has been quite a ride. We have had a pretty crazy release cycle with updates coming out weekly (and often twice a week). So I really appreciate all the users who have followed the releases and pushed both me and e to improve with their enthusiasm. Special appreciation goes to all those users who chose to register even though it was still in beta.

Coming out of beta does not mean that development will slow down. The 1.0 release is a stable base to build on and I have a lot of new (and unique) features in the pipeline. I will probably start having a bit longer between releases to focus on some larger features.

And before I get drowned in requests again. Yes, a linux version is in the works :-)


Since the latest update of wxCocoaDialog, it has been possible to use it for making custom html dialogs. This gives you a lot more freedom when creating bundle commands as you can now use far richer and more responsive dialogs in your interaction with the user.

As an example of what is possible, and how easy it is to create interactive dialogs, I have created a bundle command version of the excellent Visibone Color Lab.

The modifications to the original html code is really minor. Mainly just moving some frames around and making it update on mouseOver. The interesting part comes where i modify it to return the color code when a color is clicked:

<area HREF=”cocoadialog://%23FFFFFF” onMouseOver=”pick(’FFFFFF’,'W’,'White’)” SHAPE=”POLYGON” COORDS=”184,200,202,168,221,200″>

By giving it a link with the protocol defined as “cocoadialog”, I instruct it to react on a click by closing the dialog and returning the links content (notice the url encoding for the # mark).

To make this into a bundle command, I just have to open the Bundle Editor and create a new command containing the following two lines:

cd "$TM_SUPPORT_PATH/Visibone"
CocoaDialog html --title "The 216-Color Webmaster's Palette" --html-from-file big.html --width 380 --height 542

By first setting the current working dir to the location of the html files (and images), I ensure that the dialog can find all it’s files.

I then set input to “None” and output to “Replace Selected Text”, so that the color code will be inserted in the text when a user clicks a color.

I hope that this has illustrated how easy it is to make html dialogs. Since you have full access to using javascript in your html, there is really no limit to how freeform and interactive you can make it.

Thanks to the kind permission of Bob Stein, the Visibone creator, I have been able to include the color lab in the latest update of e. You can find it as “Insert websafe color” in the HTML bundle.

Many people think that learning to use Regular Expressions is difficult, but if you stick to the basics it is actually quite easy. This screencast and cheatsheet will give you a gentle introduction and allow you to gradually expand your knowledge into advanced usage.

Nothing can improve your ability to manipulate text as much as learning Regular Expressions, and it is not just in your editor. Just about any modern programming language support them, so you can greatly enhance your productivity and understanding of code by learning them.

The following screencast gives an introduction to the basics of regular expressions and shows how you can use them in your editor. The best way to learn is just playing around with them and watching the interactive feedback.

I have included a cheatsheet that you can use as a quick reference, and to expand your knowledge of Regular Expressions. I recommend that you print it out and gradually expand your comfort zone by trying out more and more features.

Regular Expression Cheatsheet

Ben Kittrell's rails environment

Ben Kittrell has written a straightforward how-to guide on creating the ideal Windows environment for Ruby on Rails development:

A Mac-esque Rails Development Environment on Windows

Transpose - The MultiTool

March 21st, 2007

Transpose is a versatile command that can save you a lot of typing. What it does is to ‘reverse the order of things’, but what makes it really useful is the fact that what it reverses depends on the context:

  • If the caret is inside a word, the chars on each side of the caret are swapped, and the caret is moved to after the right char. This makes for a quick way to fix typing mistakes.

  • If the caret is between two words, the words are swapped.

  • If the caret is at the beginning of a line, the line is swapped with the line above. Similarly if the caret is at the end of a line, the line is swapped with the line below. This makes for an easy way to move lines up and down through the document.

  • If there is a selection, the contents is reversed.

  • If there are multible selections (made by holding down ctrl while selecting), the selections are swapped.

  • If there is a column selection (made by holding down alt while selecting), the order of items in the entire column is reversed.

You can access it from the menu, but to really make it a timesaver, I would recommend making it a habit to use it’s shortcut Ctrl-T.

Transpose Menu