Host a TextMate Bundle on GitHub

Posted by Trey on June 23, 2008

Create a repository on GitHub

Go into the Bundle Editor and drag your bundle to your desktop and cd into it in the terminal. This is the key to the whole thing. If you just go into the bundle where it lives in TextMate, you might not get everything it needs. Dragging the file to the desktop makes it a nice, happy package ready to help other people.

Follow GitHub’s instructions to set up and push to the remote repository. Don’t forget to git add . to get everything in there.

Delete your original bundle and then clone from GitHub like so:

cd ~/"Library/Application Support/TextMate/Bundles/"
git clone git://github.com/trey/trey-tmbundle.git "Trey.tmbundle"
osascript -e 'tell app "TextMate" to reload bundles'

When you make changes to your Git-ified bundle in the Bundle Editor, you’ll need to Reload Bundles for the changes to show up in your repository. Then you’ll need to git add . and commit / push as you would a normal repository.

Source

Installing Git on OS X Leopard

Posted by Trey on February 25, 2008

It’s apparently best to install Git using both MacPorts and from source. That way you’ll get all the dependencies that are a pain in the ass to get set up, and you’ll also get the newest version of Git.

Install Git + Dependencies from MacPorts

Install the MacPorts “Leopard (Universal)” disk image from here.

If after the installation, running “which port” doesn’t show “/opt/local/bin/port“, try adding the following lines above any other path rules you have in your .bash_login file:

# MacPorts
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
export MANPATH=/opt/local/share/man:$MANPATH
# / MacPorts

Make sure MacPorts is up-to-date:

sudo port -v selfupdate

Install Git:

sudo port install git-core

Install Git from Source

Go to git.or.cz and download the newest package.

Stick the file where you want it (I prefer /usr/local/src/).

Open the file and cd into its folder. Then:

sudo make prefix=/usr/local all

(You won’t need the sudo on the last command unless you’ve got your source in /usr/local/src/, which is owned by root)

Then:

sudo make prefix=/usr/local install

If everything goes as planned, you should be able to type “which git” and see exactly this:

/usr/local/bin/git

If instead you see /opt/local/… you’re using the MacPorts version and you need to move those path rules above the other rules in your .bash_login.

Enjoy.


Bonus: TextMate Integration

To use TextMate to edit your commit messages, put the following in your ~/.bash_login:

export GIT_EDITOR="mate -w"

Install the TextMate Bundle:

mkdir -p /Library/Application\ Support/TextMate/Bundles
cd !$
git clone git://gitorious.org/git-tmbundle/mainline.git Git.tmbundle
osascript -e 'tell app "TextMate" to reload bundles'

Since Git is installed in /usr/local/bin, you’ll need to make a link to where the bundle expects it:

sudo ln -s /usr/local/bin/git /usr/bin/git

Sources:

How to color code headings in TextMate using Markdown

Posted by Trey on May 21, 2007

Preferences > Fonts & Colors

Add a new element entry like so, using the scope selector markup.heading (this doesn’t seem to effect H tags in HTML):

Custom Colors in TextMate

Use whatever foreground and background colors you want.

Project-Specific Self-Closing Tags in TextMate

Posted by Trey on May 18, 2007

If you want to switch to using self-closing tags like <img /> and <br /> in certain projects, change the shell variable TM_XHTML for that project to ” /“.

Click here:

Project Variables Button

Enter this:

XHTML for a specific project

The default behavior for TextMate is to use HTML 4, so you don’t have to do anything extra for those projects.

Deleting changes made to default bundles in TextMate

Posted by Trey on November 01, 2006

From the Help file:

If you want to discard local changes then currently the only option is to delete these from ~/Library/Application Support/TextMate/Bundles.

Of course, you can also just drag them out of that folder in case you want to add them back later. I created a folder called DeltedChanges within ~/Library/Application Support/TextMate/Bundles.