English 中文(简体)
TextMate: Adding to a bundle
原标题:

There are a couple of bundles that I would like to add some functionality 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:

  1. 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.

  2. 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.

  3. 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 .

  4. 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/.

  5. 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.





相关问题
Explain this Regular Expression please

Regular Expressions are a complete void for me. I m dealing with one right now in TextMate that does what I want it to do...but I don t know WHY it does what I want it to do. /[[:alpha:]]+|( )/(?1::$...

TextMate: Adding to a bundle

There are a couple of bundles that I would like to add some functionality to. If I update the bundles via SVN will my additions/updates be replaced?

Textmate and vim modes

It is possible to emulate vim modes, macros and bindings in textmate?

Textmate, open file at Caret

I bet this is really obvious but I can t find how to open the linked file that the Caret is currently on in Textmate. For example in the likes of Dreamweaver you can click in the index.html portion of ...

Code folding on consecutive collect/select/reject/each

I play around with arrays and hashes quite a lot in ruby and end up with some code that looks like this: sum = two_dimensional_array.select{|i| i.collect{|j| j.to_i }.sum > 5 }.collect{|i| ...

git commit -a on Mac hangs when TextMate is quitted

I have core.editor set to "mate -w". On Leopard, git commit -a starts TextMate. After entering a commit log message, saving (Cmd-S), and quitting (Cmd-Q) TextMate, git would successfully complete the ...

热门标签