12.20.06

Subversion and TextMate

Posted in TextMate at 4:51 pm by Haris

Lately there have been lots of questions about checking things out from TextMate’s Bundle repository, since in Allan’s absence the updates to the bundles won’t reach an official release for another two months. So here is a small guide on what to do.

WARNING: This will require you to type things in the terminal (Terminal.app). I am not responsible for any physical or mental damage to you or persons near you that might arise by following these instructions. But I can fairly safely say that it will not damage your computer.

First of all, read http://macromates.com/textmate/manual/bundles#getting_more_bundles for setting up subversion if you don’t have it installed yet. If you don’t feel like reading, this is what you have to do:

  1. Go to http://homepage.mac.com/martinott/ and/or http://metissian.com/projects/macosx/subversion/ and download the appropriate file. Then install it in the normal manner, probably double-clicking the download file or something like that. You will likely be required to enter your password.
  2. To check that this is done, start a new Terminal window, and type “svn” followed by return. If you get a message like: “Type ’svn help’ for usage.” then we’re in business. Otherwise, try to log out and log in again. If it still doesn’t work, then go to the ##textmate IRC channel or email the list for more assistance.

Now that you have subversion installed, there’s one more thing you need to do, and that is to add a line to your .bash_profile file. If you use another shell, then you probably know enough to figure things out on your own. If you do use bash (or if you don’t know what you are using, which amounts to the same thing), then type in the terminal:

mate ~/.bash_profile

If a file in TextMate opens, then we’re good. Otherwise, you need to first install the mate tool from within TextMate (Help -> Terminal Usage… ). Start a new Terminal window after you do that.

Ok, now you’ve got a file open in TM, which may or may not have anything in it. Add the following line somewhere there:

export LC_CTYPE=en_US.UTF-8

Save and close the window. Then open a NEW Terminal window and type:

echo $LC_CTYPE

If you see en_US.UTF-8 as a responce, you can rejoice and take a short break. We are ready for the serious stuff!

Next we need to create the directory where these things will go:

mkdir /Library/Application\ Support/TextMate
cd /Library/Application\ Support/TextMate
ls

Now, depending on whether you have checked things via subversion before, you may see a number of directories here. The ones we care about are Support, Plugins and Bundles.

If you don’t have a Bundles directory and will want to update some bundles, then create this directory now:

mkdir Bundles

Now, on to check out some items from the repository. First the Support folder (provided you don’t have it there):

svn co http://macromates.com/svn/Bundles/trunk/Support

If you don’t have the PlugIns directory as well, then you also need:

svn co http://macromates.com/svn/Bundles/trunk/PlugIns

The username and password, if you are asked, are anon.

If you want to get a bundle as well, then have a look at section 5.7.3 of the manual. Basically you will need a command like this:

cd Bundles
svn co http://macromates.com/svn/Bundles/trunk/Bundles/Haskell.tmbundle

Now for the moment you’ve all been waiting for, updating all these things! You just need this one line (after a “cd ..” if you did the cd Bundles thing):

svn up Support PlugIns Bundles/*.tmbundle

If you’ve encountered an error in any of these, then consult our friendly staff in the IRC channel or the mailing list. Enjoy!

Later