> ## Content Index
> Fetch the complete content index at: https://tim.sodhis.org/llms.txt
> Use this file to discover other available public pages before exploring further.

# Textmate and SVN
- URL: https://tim.sodhis.org/textmate-and-svn/
- Published: 2009-08-19T07:40:34.000Z
- Updated: 2009-08-27T15:57:08.000Z
- Author: Tim Sodhi
- Tags: #wordpress, #Import 2026-01-11 22:49

The shift was overdue. Although [Coda](http://www.panic.com/coda/?ref=tim.sodhis.org "Coda"), my dev app of choice, offers everything a hobbyist programmer would need, it fails miserably on one aspect. Namely, code folding. For a long time, this trade-off seemed to still justify the use of this app for day-to-day development needs, in light of its other features, e.g. easy integration with SVN, about which [I have written in the past](https://tim.sodhis.org/2009/02/18/coda-svn-support-with-versions/ "Coda SVN").

However, of late as I start to work with larger projects with a lot of embedded logic, and process flows, it has become a pain in the proverbial behind to switch from Coda to an app that will fold code. The forums and blogs are [abuzz](http://www.google.com/search?q=coda+code+folding&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a&ref=tim.sodhis.org "Google Code Collapse") with developers’ dissatisfaction with the lack of Code folding, and the staff at Coda don’t seem to care. If only I could configure SVN with [TextMate](http://macromates.com/?ref=tim.sodhis.org "TextMate"), and that too in a comprehensive, intuitive way, I could move away from Coda, forever. It seemed to be a pipe dream, i.e. till now. I have successfully set up SVN with TextMate and in a way that mirrors the ease of *COMMIT*, *REVERT*, *DIFF* found in Coda. Here’s a how-to.

This is what you’ll need at the get go.

1. [TextMate](http://macromates.com/?ref=tim.sodhis.org "TextMate") editor (of course)
2. SVN Frontend (if you don’t want to finagle with the terminal). I use [CornerStone](http://www.zennaware.com/?ref=tim.sodhis.org "CornerStone").
3. [FileMerge](http://en.wikipedia.org/wiki/Apple%5FDeveloper%5FTools?ref=tim.sodhis.org "FileMerge") (from XCode dev tools – recommended) or [Changes](http://connectedflow.com/changes/?ref=tim.sodhis.org "Changes App").
4. [SVNMate](http://ciaranwal.sh/2007/11/29/svnmate-update?ref=tim.sodhis.org "SVNMate") Plugin for TextMate.
5. [FileMerge](https://tim.sodhis.org/downloads/textmate-filemerge.zip "FileMerge") Plugin for TextMate.

Create a SVN repository with the software of your choice. I usually create one on an external drive (as I need access to my code offline from time to time). Note down the local or remote URL. In my case it is 

> file:///Volumes/ExternalHDD/CodeRepo/MyProj/.

Double click the SVNMate.tmbundle file, and it will insitall itself in your 

> \~/Library/Application Support/Textmate/Bundles/. 

Do the same for the FileMerge Plugin as well. Now is the time to configure. Open a blank file with Textmate and in the Bundles Menu 

> Bundles->Subversion->CheckOut. 

[![](https://tim.sodhis.org/content/images/wordpress/2009/08/Picture_3-thumb1.png)](https://tim.sodhis.org/content/images/wordpress/2009/08/Picture%5F31.png)

Enter the local or remote SVN URL, and choose a folder in which you’d like to check out the files. That was easy. At this point you are pretty much set with SVN on TextMate. You will see icons displayed next to the files in the file browser, indicating their subversion status. That’s the beauty of the SVNMate plugin we just installed. Any changes you make to your files will alter the icon status to signify changed content. You can fire up the commands using CTRL-SHIFT-A to bring up SVN commands. But – you could make your life easier by setting up the following options as well. This is a matter of choice of course. 

***Changing the default icons for SVNMate***  
Change the default SVN status icons by going to TextMate preferences. Preferences->SVNMate and choose a set that catches your fancy.

[![](https://tim.sodhis.org/content/images/wordpress/2009/08/Picture_7-thumb.png)](https://tim.sodhis.org/content/images/wordpress/2009/08/Picture%5F7.png)

***Using FileMerge***  
Instead of using the TextMate SVN diff file viewer to see the changes since the last commit, use FileMerge. It is included in XCode developer tools, and is perhaps the best viewer, with split side-by-side views. 

[![](https://tim.sodhis.org/content/images/wordpress/2009/08/Picture_8-thumb.png)](https://tim.sodhis.org/content/images/wordpress/2009/08/Picture%5F8.png)

***Use Tab Triggers in TextMate***  
Perhaps the BEST feature so far – use TextMate tab triggers to trigger SVN events. Tab Triggers are used in TextMate by assigning a set of letters followed by a *TAB* key press, to trigger an associated event. You can pretty much do anything you like with Tab Triggers, from inserting pieces of Code in TextMate to SVN file commits. To set up a Trigger for an SVN Commit, go to Bundles->Bundles Editor->Commands. Choose Subversion from the list. Choose a command from the list, and in the right pane choose a method of Activation from the Drop down – Tab Trigger. To it, assign any combination of words. I chose “commitsource” for *COMMIT*. 

[![](https://tim.sodhis.org/content/images/wordpress/2009/08/Picture_9-thumb.png)](https://tim.sodhis.org/content/images/wordpress/2009/08/Picture%5F9.png)If you prefer to view the differences in FileMerge instead of the inbuilt diff viewer, in the same window (Bundle Editor) choose FileMerge in the list and edit the Revision Command. 

[![](https://tim.sodhis.org/content/images/wordpress/2009/08/Picture_10-thumb.png)](https://tim.sodhis.org/content/images/wordpress/2009/08/Picture%5F10.png)

Voila, it just works. To see the new Tab Triggers at work, type the keyword inline with the code, and press Tab. 

[![](https://tim.sodhis.org/content/images/wordpress/2009/08/Picture_11-thumb.png)](https://tim.sodhis.org/content/images/wordpress/2009/08/Picture%5F11.png)

Don’t worry, the keyword disappears from the code as soon as you close the FileMerge (or the associated app window). Simply wunderbar.

[![](https://tim.sodhis.org/content/images/wordpress/2009/08/Picture_12-thumb.png)](https://tim.sodhis.org/content/images/wordpress/2009/08/Picture%5F12.png)

So indeed, it is time to move to TextMate and stop bemoaning the lack of Code Folding.