Open in Textmate, Custom Shortcut

General discussions about LaunchBar
Post Reply
jaaay
Posts: 5
Joined: Sun Feb 22, 2009 6:56 pm

Open in Textmate, Custom Shortcut

Post by jaaay » Sun Feb 22, 2009 7:17 pm

I'm trying to accomplish two things which I feel must be possible, but I can't figure out how to do it in LaunchBar.

I would like to specify certain files to open in the editor of my choosing. Specifically, I open these two files quite a bit:

/etc/hosts
/etc/apache2/extra/httpd-vhosts.conf

1. I would like to be able to type "hosts" and have /etc/hosts open in Textmate. Currently the closest I can get is typing "etc" which pulls up the "etc" folder in launchbar, which I can then navigate to the hosts file using the keyboard. When I get to it, the file opens in TextEdit, which does not allow me to save the file because of write permissions (Texmate gives me the option of entering an administrator password).

2. I would also like to make per-editor shortcuts. That is, I would like to type mate [space] and then type /etc/hosts (or the path to any other file). Or, to type bbedit [space] followed by the path to a file.

I feel like these things must be possible, but I can't figure it out. When I try to assign a shortcut to hosts using command-option-a, I get a message telling me the directory is not in the index (though /etc is definitely in the index) and even if I were to be able to solve that problem, I don't see where I could specify which editor would be used.

So, to recap, here's what I'm after:

mate [space] hosts
bbedit [space] vhosts

Thanks!

Dennis
Rank 3
Rank 3
Posts: 146
Joined: Mon Dec 10, 2007 7:47 pm
Location: California

Post by Dennis » Sun Feb 22, 2009 8:47 pm

Have you tried typing the name of the file you want to open, then hit Tab and type the name of the app you want to open it with?

As for /etc being in your index, do you have LaunchBar set to scan the contents of the directory or just the directory name itself?

Note that if you're simply using LaunchBar's "Unix Directories" custom list, it only indexes the directory name itself, not the contents of /etc.

To scan the contents of /etc, you'll need to add a new folder to LaunchBar's index. Hit Command-Shift-G at the folder selection prompt and type in "/etc" to get to the directory and then add it to LaunchBar.

In the right pane of LaunchBar's index window, you should now see the hosts file (among other things) listed.

-Dennis

jaaay
Posts: 5
Joined: Sun Feb 22, 2009 6:56 pm

Post by jaaay » Mon Feb 23, 2009 7:57 pm

Thanks! I'll give it a shot. Some issues to be worked out with the intuitive-ness of what's indexed and what's not, but sounds like your suggestions will work. Thank you.

Post Reply