espresso

Espresso And Syntax Highlights for Custom File Formats

I like Espresso from MacRabbit for server-side scripting a lot. The latest version (2.0) has merged a wonderful code editor with the best-of-the-class CSS editor, giving one awesome, unified experience. And, of course, you can edit your files directly over an SSH connection (the latter, alas, is not as straightforward as it is in Panic's Coda, but, well, we love both of them for different reasons).

Nothing in this life is perfect, however. One glaring shortcoming of Espresso is: no UI for assigning a syntax highlighter to custom file extensions. Espresso recognizes most common file extensions, but if you do something slightly different, e.g.: use .tpl files in Drupal (which are PHP files) or use Handlebars templates in Javascript (which are basically HTML), you won't get default syntax highlighting because Espresso does not know what type of files these are.

Let's see how we can teach Espresso custom file types. I will do this for .handlebars files, which are template files I use for my Javascript coding.

  1. Right-click on Espresso.app in Finder and select: "show package contents".
  2. Go to folder: Contents > SharedSupport > Sugars
  3. Right-clic on "XML-and-HTML.sugar" and select: "show package contents".
  4. Open Languages.xml for editing (with vi, Textmate or whatever your favorite text editor is)
  5. Scroll down to detectors section which should read something like:
    <detectors>
      <extension>html</extension>
      <extension>htm</extension>
      ...
    </detectors>
  6. Add more extensions to the section, e.g. for handlebars, I added:
    <extension>handlebars</extension>

Adding Drupal, Django and JQuery Support to Espresso

MacRabbit's Espresso (http://macrabbit.com/espresso/) has been my favorite editor for server-side scripting for a while now. I was an avid Coda user before that, and Coda is a fine editor, but I like several features of Espresso better (e.g. large file browser in the center and ability to simultaneously open files from any number of servers).

Espresso is much "younger" than Coda and it was a little behind on language support (and availability of plugins in general), initially. We even had to post a hacking instruction for how to "teach" Espresso Drupal files. (UPDATE: new instructions at: http://freshblurbs.com/espresso-and-syntax-highlight-custom-file-formats)

The situation is much different now. There's a wonderful abundance of quality plugins now at http://fileability.net/coffee/ that work like a charm. We are using Combined Python&Jango, JQuery, YAML and Drupal-PHP sugars and they are simply awesome. To install, all you need is download appropriate tar.gz, unarchive. rename resulting folder so it has extension .sugar and move that to ~/Library/Appplication Support/Espresso/Sugars

Teaching Espresso Drupal PHP file Extensions (e.g. .module)

UPDATE: instructions for Espresso 2.0 at: http://freshblurbs.com/espresso-and-syntax-highlight-custom-file-formats

Espresso From MacRabbit (you may remember them for their splendid CSSEdit eidtor) is a new Web editor, for Macs, worth paying attention to. It handles the usual suspects: PHP, CSS, HTML, servers over SFTP, Amazon S3 etc with style out of the box and has numerous extensions for other things like Python, LUA, SQL, Regular Expressions etc. And it's only 1.x version, so you bet you can expect much more in coming versions.

One little shortcoming it had, for Drupal developers is that, there's no easy way to configure custom-for-Drupal PHP extensions: .module and .install to make Espresso recognize these as PHP files.

Joe Shindelar of Dreamformula has posted a nice blog post detailing the configuration of custom PHP extensions in Espresso.

Thank you, Joe!

Syndicate content