TextMate: Adding to a bundle
There are a couple of bundles that I would like to add some fu开发者_开发知识库nctionality to. If I update the bundles via SVN will my additions/updates be replaced?
Generally, you should check out a bundle's repo in the global /Library/Application Support/TextMate/Bundles
directory; then, if you make any changes, the changes will be stored in ~/Library/Application Support/TextMate/Bundles
, and you can easily (a) undo changes, or (b) update bundles without conflict.
To be honest, I forget what happens if you check out bundles to ~/Library/Application Support/TextMate/Bundles
instead; I think your own changes get mixed in with the bundle itself, which can create conflicts when updating.
Here's the idiot-proof way to to make sure you don't unintentionally overwrite your custom-edited version during a Bundle update:
Instead of editing an existing bundle, create a new one (bottom left-hand corner of the Bundle Editor, click on the "+" dropdown then click 'New Bundle') and give it a unique (but descriptive) name.
Then just copy+paste the snippets, macros, commands, etc. that you want to modify, from the original bundle, to new snippet/macro/command windows in the Bundle Editor and start editing.
You might want to give Bundles you create this way names that begin with your initials followed by the name of the bundle you modified, e.g., 'DY-python'.
But it's not the unique name that you rely on to keep them from being overwritten. Actually, TextMate recognizes these by the fact that the name doesn't match the name of any Bundle in the Repository, and so, behind the scenes, TM stores them in a location different from the other Bundles, e.g., ~/Users/dougmbp/Library/Application\ Support/TextMate/Bundles, for the user-modified ones, while the default location for TM Bundles updated from the repository is /Applications/TextMate/Contents/SharedSupport/Bundles/.
There is absolutely no discernible difference to the user in how these two types of Bundles behave--they are accessed, edited, and called just like the conventional Bundles. This way, your modifications will survive Bundle updates, TM version updates, and well as bad things (just make sure you add the path above to your list of back-up locations).
No but if you additions conflict with changes made in SVN you will need resolve those conflicts by comparing and editing the two versions.
精彩评论