Muffinresearch Labs by Stuart Colville

Use Tabs in Textmate for Files Opened Via Transmit | 62 Comments

Posted in Software on 13th June 2006, 9:30 am by

UPDATE: For opening tabs in transmit 4 see comment #49

Screenshot showing tabs in textmate

I really love TextMate. Everything about it oozes productivity. The only thing that I could say I didn’t like was that there was no way to edit remote files in textmate (opened via transmit) using the tabs. That is up until now.

Tabs in TextMate are only available when you are using the projects feature. Opening a file with textmate by default opens in a single window. Thus if you use Transmit and set Textmate as your default editor every file you open via transmit will open in a separate window. This is fine but if you are working on a large project switching back and forth between windows fast becomes a pain.

I went onto the textmate IRC channel today and I was asking to see if there was any way round this problem. Someone very kindly pointed me in the direction of this thread on the textmate discussion board: [TxMt] sweet textMate FTP project window goodness!

This thread was posted by Thomas Aylott and details how to open the temporary files in tabs when using CyberDuck and Textmate. Here’s how to carry out the same method with Transmit. Allan Odgaard, the author of TextMate, helped me sort this out so thanks go to Thomas and Allan for making all this possible, I am purely documenting this so that if anyone is looking for how to do this is should be easily found.

The How-to

First off transmit doesn’t use one directory for it’s temporary files so you need to watch the parent folder. You will find this here:

~/Library/Caches/TemporaryItems/Transmit/

aka:

/Users/<your_username>/Library/Caches/TemporaryItems/Transmit/
  1. In Transmit set textmate up as the default editor. See screenshot
  2. In TextMate open a new project.
  3. Click on the cog icon in the project drawer and selet “add existing files”. See screenshot
  4. Then find your way to the ‘/Users/<your_username>/Library/Caches/TemporaryItems/Transmit/’ directory as detailed above. Set this as the directory and click ‘open’. See screenshot
  5. Next select the transmit directory that’s visible in the project drawer and click the info button (i) at the bottom right of the project drawer. See screenshot
  6. Delete everything shown in the ‘folder pattern’ field and close the window. See screenshot
  7. Close the project drawer. You can leave it open if you wish this is a personal preference.
  8. Save the project file! Give a useful name like ‘transmit’. If you don’t save it then this special config will be lost and you will need to repeat these steps.
  9. Lastly open a file directly from transmit and you should see the file open in a tab. See screenshot

There you have it. Next time you want to use this simply open the transmit project file (you did save it right?) and start opening files from transmit and they will be opened straight into tabs.

Post Tools

  • http://www.bureau-de-mischief.net Arthur Case

    Great article, thanks!

    I just had one issue where I was attempting to find the TemporaryItems folder after a fresh reboot and it wasn’t there. Just opening a file via Transmit made this folder appear so I could add it to the project.

  • Freddy Fredland

    Yeah hi … this is such an obvious step forward. This is one of those functionalities that you never really think through on the white board, but someone like yourselves throws out an Ah Ha moment. Thank you for the work around. If TextMate is listening … one small step for your product … one giant leap for the developer world.

    High five.

  • http://www.pixelenvy.co.uk Nick Harris

    This is the sole reason that I use BBEdit over Textmate. I tried your technique, and it works once, then the TemporaryItems folder disappears. I can’t even get it back by opening a file from transmit :(

  • Henrik N

    Only worked once for me, too. Closed TM and Transmit and then tried editing two files – they opened in separate windows, without tabs.

    Some very quick testing suggests it only works if the project is currently open in TM when you invoke “edit in TM” from Transmit.

  • http://muffinresearch.co.uk Stuart Colville

    @Henrik: I did say (see the last paragraph) that you will need to open this project every time you want this to work! For me TextMate opens this as when I open TextMate as it’s the last thing I had open.

    If you are having trouble with the TemporaryItems directory being cleaned up you could try creating a readonly file and dumping it in there as a kludge to prevent it dissappearing. YMMV.

  • http://subtleGradient.com Thomas Aylott

    Total. Kludgy. Sweetness. ;)

    Yee haw!

  • http://ajaxon.com Michael Jackson

    Thanks for documenting this useful tip! I was thinking about switching back to BBEdit just because I thought TextMate lacked this feature!

  • http://www.masugadesign.com Ryan

    Mmmmm…this just helped me out quite a bit tonight. I have BBEdit but it’s just so damn ugly and not-fun. I use ExpressionEngine a lot these days, so I edit files remotely more often than I used to. I thought this might be a TextMate killer for me.

    This tip, paired with the TextMate ExpressionEngine Bundle make me feel as if I’m editing on my local machine. Thanks!

  • idea

    THANK YOU. I had horrible thoughts of going back to DreamWeaver, simply for the lack of the tabbed organization. I feel much better now.

  • http://www.masugadesign.com Ryan

    What do you do when this stops working? I’ts been working fine for a few weeks, and then all of a sudden, it stopped. I open TextMate, then open the “Remote Project”, then open a file from Transmit – and it opens in a new window rather than the Remote Project window.

    I’ll tell you, the remote editing is one thing BBEdit has over TextMate…

    Do I just make a new remote project all over again? Any help getting it working again is appreciated.

  • http://muffinresearch.co.uk Stuart Colville

    @Ryan: Hmmm I’m not sure why that happens but the quickest thing is to just recreate the project.

    I totally agree with you that it would be nice to just have a setting that opens all new files into a new tab but who knows maybe that will happen in the next version?

  • http://www.sameagain.net Jasper

    thanks very much for this tip. I tried Subethaedit, but its lack of file browser put me off. Skedit’s cool but its syntax colouring it a bit rubbish. This has just made TextMate the winner for me! Hopefully we’ll see future versions have an ftp drawer like Skedit :)

  • Erwin Heiser

    Thought I had found the solution to the one problem I stil have with Textmate but this just won’t work for me. I can’t believe that something which is trivial in BBEdit is such a pain to pull off in Textmate :(

  • http://neil-scott.com Neil

    A lifesaver (well, not quite, but almost)! Thankyou!!!

  • tom

    Yeah, but you lose all directory information. Everything in random .tmp folders is useless when working on a Rails project, for example.

  • http://muffinresearch.co.uk Stuart Colville

    @Tom: not quite sure what you mean. Feel free to explain in greater detail the problem you are experiencing.

  • http://www.idallas.com/ Dallas

    I think I have the same problem tom mentioned. Using this method you can only see filenames and not the full ftp/sftp server path. If you have code with multiple files with the same name in different directories, it’s difficult to tell them apart. BBEdit shows the path up at the top of the window and makes it easy.

    I keep waiting for the time when I can seriously consider switching to TextMate and this tip gets me a whole lot closer, but without the ftp path I think I have to keep waiting.

  • http://www.brendoman.com/dbc Danny

    This worked for a couple of weeks for me, then the TemporaryItems directory vanished. I recreated it and the Transmit dir inside it, restarted Transmit and now it’s working again.

  • http://www.brendoman.com/dbc Danny

    The TemporaryItems directory continues to randomly disappear I guess I’ll have to go back to separate windows until this is built into TextMate. Bummer.

  • http://www.hermanobrother.com Gaston

    This is fantastic. With the whole CODA boom right now, I’ve wondered why in the world I would need to use it… and the only reason was to edit files comfortably from FTP.

    Whith this little hack, I see no reason at all to keep on using CODA. It’s a great product, but it’s light years behind Textmate as a Text Editor (light years, really).

    Thanks so much for this.

  • http://hunch.se Rasmus

    OR, you could use FuseFS (Mac-version maintained by Google) to mount a remote tree over ftp with write-access. Alas works exactly like a local file tree. Very neat. Very convenient.

  • http://www.masugadesign.com Ryan Masuga

    I’m sort of falling off the Transmit truck – it has really been conking out on me too much lately. Too many connections refused by the server, etc.

    So, would anyone know of a way to get this Transmit trick to work with YummyFTP, which (and I’m still using the demo) seems much faster than Transmit?

    Coda is cute and all, but I’m really married to Textmate as far as a text-editor goes.

    FuseFS sounds interesting but might be beyond my feeble brain to comprehend or use.

    I really agree with Erwin (#13) – BBEdit has this down and I wish it were just part of what Textmate could do naturally.

  • http://muffinresearch.co.uk Stuart Colville

    @Ryan: You should be able to do exactly the same trick you just need to locate where YummyFTP stores the temporary file downloads. Try looking in the application support folder.

  • http://muffinresearch.co.uk Stuart Colville

    @Rasmus: If this works for you great. I found SSHFS via MacFUSE a touch unreliable unfortunately. There are always other possibilities though, SMB or NFS mounts etc.

  • http://www.pitslamp.be Bunker

    @Rasmus and Stuart:

    The macFUSE and SSHFS trick works and is a lot easier with MacFusion but there is one problem the MacFuse core is not yet very reliable.

    If somebody else has edited a file you have open, your file is fubar untill reboot and sometimes it causes kernel panic.

    @Ryan: Did it work out to locate the temp folder for yummy? I’m also using yummy ftp at home.

  • http://elliottcable.com elliottcable

    One thing worth noting is this interesting… bug?

    If the textmate project window is already active (has focus in cocoa) when the transmit transfer completes, it’ll open in a new window instead of said project. Not sure why.

    A more relevant side effect of this is that if you don’t wait for each transfer to complete before starting another one, the textmate window will have focus as soon as the first completes (when a transfer completes it switches focus to textmate immediately), so the second one will open in another textmate window; this means the project has lost focus again, so the third file goes back to the project; fourth to it’s own window, 5th to project window, and so on. It’s annoying and odd behavior.

    tl;dr – you can’t select a bunch and open them all at once, you have to open files one at a time

  • Jon Gales

    You are my hero. This was my one gripe with working on external files. Thanks!

  • http://rogergordon.net Roger Gordon

    Thanks a lot for this. I recently switched from Cyberduck and Smultron to Transmit and Textmate. I was about to drop Textmate due to this problem, but your article saved the day! Thanks so much.

  • http://www.tyznik.com Michael Tyznik

    I’ve been using this method for a while now, but it’s stopped working recently. Looking into it, it seems like it might be an update of Transmit that broke it. The folders Transmit uses to store temporary items are hidden now (starting with .). Were they hidden before, or is this new? Do you know of a workaround?

  • http://muffinresearch.co.uk Stuart Colville

    @Michael: I think they were. I’ve tried this from scratch and it works the only thing that failed was opening a file beginning with a period. The solution was to simply put * as the ‘file pattern’ instead of blanking it.

  • Joon

    Is there a solution to have tabs in textmate with Coda?

  • http://muffinresearch.co.uk Stuart Colville

    @joon: Sure you’ll probably be able to do the same thing; just look for the temporary files from coda and set it up in the same way.

  • http://www.aaronharp.com Aaron

    Thanks man! So handy…

  • Ron

    Bloody brilliant!

  • http://natebeaty.com/ nate beaty

    This also works for Forklift, which stores tmp files in ~/Library/Caches/com.binarynights.ForkLift/

    Thanks for the tip! Makes remote editing that much better. (It took me a while to get used to not having ftp built into my editor, but at this point I prefer it.)

  • http://www.aetherworld.org/ Alexander Graf

    That’s a live saver, seriously. Thanks a lot for that tip!
    I got here through some other site but I’ll visit your blog more often now.

    Thanks again!

  • http://velin.dk Jacob Velin

    Great article! Thank you for the thorough walk-through.
    Cyberduck has been crashing a great deal on me lately while doing this type of remote editing via TextMate, so now I’m giving Transmit a go.

  • http://platformpeace.com/textmate-tabs-editing-files-transmit/ Ryan

    Great tip – makes life a little easier!

  • Greg Hinch

    I’ve been using this method for a while now and loving it, and then suddenly today it stopped working. The TemporaryItems folder in ~/Library/Caches seems to have disappeared! I created it again but Transmit no longer appears to be sending temp files here. Any ideas where they’re going now? Anyone else had this happen?

  • Greg Hinch

    Nevermind figured it out, just had to repair disk permissions and Transmit recreated the directory. Also I should have read the previous comments, duh.

  • Altsi

    Nice, I was wondering how this could be done!

  • http://fleethecube.com Cesar Gonzalez

    I’ve had this set up for years, and recently during an upgrade it stopped working. I erased my old “Transmit” project, redid the process, and it looks like it’s working again. Thanks!

  • http://www.viewbook.com resrc

    Thanks! Works great, used Coda for remote editing, but this is much better……

  • Jake McGraw

    effing saved, this is the best

  • http://www.chicagostyleseo.com/ roddesu

    I can’t thank you (and Google for indexing this post!!) enough for figuring this out. I was sitting looking at a big project this morning and dreading all the command + ~ I was going to have to do. This saves me from buying Coda.

  • lippe

    Am I the only one having trouble with this on Snow Leopard? I’ve been using this tip since I got my laptop, but all of a sudden (after upgrading to SL), the files are no longer getting opened inside the Transmit-project.

    I’ve tried making a new project following this tutorial with no success.

  • http://muffinresearch.co.uk Stuart Colville

    @lippe: I’d take a look but since I don’t have a mac at all any more it’s a little bit tricky.

  • Ludovic Kuty

    Great tip ! Thanks for sharing.

  • http://taenzer.me Sebastian

    Thanks to Stuart for this back in 2006. Since the release of Transmit 4 today the paths have changed. I posted about this in my blog at http://blog.taenzer.me/textmate-open-files-from-ftp-in-tabs-with-tra

  • Tim Sawyer

    Any idea how we do this in the just released Transmit 4? The cash seems to be hidden in a different place than in 3.

    Tim

Insert a tab character in vim when expand tabs is on|(0)

I have vim set-up to use spaces in place of tabs. Sometimes you need to use an actual tab e.g. editing a Makefile. Now whilst it’s possible to change settings so that tabs are used for specific files, a quick tip to remember is to simply type in insert mode:

Ctrl+v tab

That is Ctrl and “V” and hit the tab key, et voila you’ve entered an actual tab.

GNU screen: open tab in current working directory|(1)

A nice trick for having screen open a new tab in the same directory as the one you’re currently in. To use it add it to your .screenrc

# Open new window in current dir.
bind c stuff "screen -X chdir \$PWD;screen^M"
bind ^c stuff "screen -X chdir \$PWD;screen^M"

Hat tip: mteckert on SuperUser.com

Photos on Flickr

© Copyright 2004-13 Stuart Colville, all rights reserved. May contain traces of Muffin. Powered by WordPress. Hosting by Slicehost.com This page was baked in 0.497s.