TextMate:添加到捆绑包

发布于 2024-08-14 07:05:09 字数 51 浏览 3 评论 0原文

我想向几个捆绑包添加一些功能。如果我通过 SVN 更新捆绑包,我的添加/更新会被替换吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

旧故 2024-08-21 07:05:09

一般来说,您应该在全局 /Library/Application Support/TextMate/Bundles 目录中查看捆绑包的存储库;然后,如果您进行任何更改,更改将存储在~/Library/Application Support/TextMate/Bundles中,您可以轻松地 (a) 撤消更改,或者(b) 更新捆绑包而不发生冲突。

老实说,我忘记了如果您将捆绑包检出到 ~/Library/Application Support/TextMate/Bundles 会发生什么;我认为您自己的更改会与捆绑包本身混合在一起,这可能会在更新时产生冲突。

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.

情泪▽动烟 2024-08-21 07:05:09

这是一种简单的方法,可确保您在捆绑包更新期间不会无意中覆盖自定义编辑的版本:

  1. 不要编辑现有捆绑包,而是创建一个新捆绑包(捆绑包编辑器的左下角) ,单击“+”下拉菜单,然后单击“新捆绑包”)并为其指定一个唯一(但具有描述性)的名称。

  2. 只需将要修改的片段、宏、命令等从原始包复制并粘贴到包编辑器中的新片段/宏/命令窗口并开始编辑即可。

  3. 您可能想给您以这种方式创建的捆绑包命名,该名称以您的姓名首字母开头,后跟您修改的捆绑包的名称,例如“DY-python”。

  4. 但这并不是您用来防止它们被覆盖的唯一名称。实际上,TextMate 通过名称与存储库中任何 Bundle 的名称都不匹配来识别这些文件,因此,TM 在幕后将它们存储在与其他 Bundle 不同的位置,例如 ~/Users/dougmbp /Library/Application\ Support/TextMate/Bundles,对于用户修改的,而从存储库更新的 TM Bundles 的默认位置是 /Applications/TextMate/Contents/SharedSupport/Bundles/。

  5. 对于用户来说,这两种类型的 Bundle 的行为完全没有明显的区别—​​—它们的访问、编辑和调用就像传统的 Bundle 一样。这样,您的修改将在捆绑包更新、TM 版本更新以及不良情况下幸存下来(只需确保将上面的路径添加到备份位置列表中)。

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

回忆追雨的时光 2024-08-21 07:05:09

不需要,但是如果您添加的内容与 SVN 中所做的更改发生冲突,您将需要通过比较和编辑两个版本来解决这些冲突。

No but if you additions conflict with changes made in SVN you will need resolve those conflicts by comparing and editing the two versions.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文