Espresso Code Editor - How to open a directory from the command line (like TextMate)

We had a number of interesting conversations last night at the Keene (NH) Drupal User Group meeting and one of them centered around text editors. Recently, I've been playing with Espresso and REALLY liking it. However, a great question that Damien McKenna asked was if you could open a directory in Espresso like you do in TextMate. For example, let's say I wanted to open an entire folder, e.g. httpdocs, to appear like a project. I would enter the following in Terminal:

mate httpdocs

With a little exploration, I was able to pull this off to make it a similar experience:

espresso httpdocs

Here's what you need to do:

  1. Open (or create) a file in your home directory called .bash_profile using your favorite text editor. (It would be kind of ironic to open it using TextMate). :-)
  2. Add a line anywhere in the file as follows: alias espresso='open -a Espresso'
  3. Save the file.
  4. Close your current Terminal window and open another one. (OSX executes the .bash_profile script when you open a new terminal window which is why we have to exit and open a new window)

Now you should be able to open a directory in Espresso just by typing "espresso" followed by the path you would like to open.

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
5 + 1 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.