[TxMt] Re: Open a specific file with a certain keystroke?

Dru Kepple dru at summitprojects.com
Thu Nov 12 17:30:41 UTC 2009


You could probably create a very specific command in TextMate, bind a keystroke to it, and you should be good to go.

(I'm making the assumption that I need to walk you through these steps...my apologies if this is over simple for you)

Go to the Bundle Editor (Bundles > Bundle Editor > Show Bundle Editor...or Command-Option-Control-B, a shortcut I use a lot).

You should have a "Your Name's Bundle"  I'd put this command in that bundle.  Click on that bundle.

In the little button at the bottom with the "+" and the down-facing triangle, click on it and choose New Command.

Give it a Name

In the interface on the right, choose Save: Nothing, Input: None, Output:Discard, and type this into the "Command" field:

mate ~/Desktop/Test.txt

Where "Test.txt" is the file on your desktop.

In Activation, choose "Key Equivalent" from the popup menu and type the desired shortcut into the field.  Leave the scope selector blank.

The potential drawback to this is that this will only work in TextMate.  That may or may not be what you want.  But not only will it only work in TextMate, it will only work if you have a text file open and focused.  Bundle items can't be triggered if you're not working in text.  Most of the time, that's not an issue, but every now and then I forget and can't figure out why I can't access the Subversion commands in my new project...

If you want more global access to the file, you can look into using Quicksilver or Butler to create a global hotkey that will always work (you can even specify which apps for it to be active in).  I won't get into those details now, but would be happy to provide further details if you need them.

Hope that helps,
+dru

-----Original Message-----
From: textmate-bounces+dru=summitprojects.com at lists.macromates.com [mailto:textmate-bounces+dru=summitprojects.com at lists.macromates.com] On Behalf Of Marius Hofert
Sent: Wednesday, November 11, 2009 10:57 PM
To: textmate at lists.macromates.com
Subject: [TxMt] Open a specific file with a certain keystroke?

Dear Textmate Users,

I am working on a Mac OS 10.6.1 with textmate version 1.5.7. I have a specific .txt file on my Desktop which I frequently open to put in some text. How can I define a keystroke/key combination such that this specific file is open and shown on top of all other open applications?  
Is this even possible? If so, is this a Mac-kind-of-thing or can this be achieved with textmate? With "System-Preferences -> Keyboard -> Keyboard Shortcuts" I could not get this to work.

Cheers,

Marius


_______________________________________________
textmate mailing list
textmate at lists.macromates.com
http://lists.macromates.com/listinfo/textmate



More information about the textmate mailing list