tags:

views:

58

answers:

1

I bet this is really obvious but I can't find how to open the linked file that the Caret is currently on in Textmate. For example in the likes of Dreamweaver you can click in the index.html portion of <a href"index.html" hit cmd-D and it opens this file in a new tab. Is this possible?

Would also be good to do this with <img src="image.jpg" to open the file directly into Photoshop.

A: 

I don't have a full solution as a linked bundle but this should get you close.

You can use the Bundle Editor to create a command that will open an image if you select the path. Create a new command and enter this:

open "$TM_DIRECTORY"/"$TM_SELECTED_TEXT"

Set Input to Selected Text or Word
Set Output to Discard
Set Key Equivalent to an unused key combination.

Close the editor. Now you should be able to select an image path and it will open when you press the appropriate keyboard shortcut.

You can add the -a flag to the open command to specify which application to use to open the selected file. This is just a basic example and not an entire solution that will work with every type of file path.

You can get info on Textmate environment variables here.

daustin777
Perfect daustin777.It's exactly what i need, the file types open in their default app which is exactly what I was looking for. Cheers.
amjags