Textmate File Open tip: type a forward slash, get an open path box

Posted by amy on August 10, 2007

Yesterday I discovered, entirely by accident, that when you’ve got an Open File window in Textmate, hitting the forward slash / does precisely what you’d like it to do: drops down a box that allows you to type the path to the file to open, complete with tab completion, as in a command prompt.

I’m sure everyone in the world already knew this, but I’m still pretty new to Textmate, and even though I have the excellent Textmate book, there are only so many tips and shortcuts your brain can pick up at once.

It turns out that ordinary Finder windows also have a shortcut to get a path text entry box, but it’s not nearly as intuitive ( command-shift-G) as a simple /, and the tab completion is not as nice, because it tries to discourage you from getting into the guts of your computer. For example, in Textmate, if you type /u – tab, it gives you /usr; in the Finder, it tries to give you /Users . I understand that this makes sense for the average Finder user, but it’s still oddly disorienting.

Through the wonders of google, I just found out that there’s a way to make your Finder stop hiding root:

As you know, the Finder hides the standard Unix files and folders from you. You can “Go To Folder…” and type in the name of the folder such as /var/log, but that’s fiddly and you still don’t see the “dot” files, so for any serious session, it’s probably easier to drop into Terminal. Except, there’s a terminal command that will make all files and folders display in your Finder. defaults write com.apple.finder AppleShowAllFiles -bool true et voila

This works, I’ve tried it, but then I put it back the way it was because I decided I really didn’t want my dad mucking around in root while he’s checking his email. (Sorry, Dad.)

It’s easy to forget that the windowing system is just a windowing system — it’s not the OS. And that Finder is just an application. And that even the command prompt, which I am comfortable enough in (but not like Max, who is really one of the best commandline geeks I’ve ever known) is just a shell. Abstractions on top of abstractions, and all of them leaky…

Popularity: 11% [?]

Theoretically Related Posts
  • The Web, 2007: Why does javascript still exist?
  • 12 Steps to Testing in Rails
  • /usr/bin/file rules, even when it’s wrong
  • hah!
  • Trackbacks

    Use this link to trackback from your own site.

    Comments

    Leave a response

    1. Chris Fri, 10 Aug 2007 11:34:44 UTC

      This is a feature of the standard Mac OS X open and save dialogs. It’s not unique to TextMate.

    2. amy Fri, 10 Aug 2007 11:42:34 UTC

      Really? I’ve tried it on a ton of applications and the only other thing it works in is Terminal. Which is convenient, but how often am I opening something using a finder dialog box in Terminal? Like I said, you can get almost the same thing using command-shift-g, but I like just the /.

    3. max Fri, 10 Aug 2007 12:26:28 UTC

      I am _delighted_ to learn this — I hate the standard file-browse dialogue. As for viewing the whole filesystem through the Finder, I’m happy about that too, but it’s not quite as critical — it’s rare that I need to reach /var/log, for example, outside of a terminal session.

      The / doesn’t seem to behave as Chris mentions universally in OS X apps. For example, Thunderbird does it, but Firefox doesn’t (in all contexts).

    4. max Fri, 10 Aug 2007 12:34:07 UTC

      Ouch, that MacGeekery article has a shudder-inducing comment from a poster trying to get in waaaaay over his head:

      how do I get into terminal?

      will this allow me to delete files I don’t want found on my computer? If so, how do I know which files I need to remove?

      I’m not very computer savvy, but need to cleanse my computer.

      Any help would be greatly appreciated.

      He should just issue “sudo rm -rf /” and he’ll be completely clean.

    Comments