TextMate 括号插入
请注意,我确实在超级用户上询问过这个问题,但没有收到任何回复,因此我决定将其移植到对 TextMate 了解更多的编程社区。
在 TextMate 中使用 Ruby on Rails 工作时,当我选择一段文本,然后
My text
按键盘上的开括号 [
键时,TextMate 会将所选块括在左括号和右括号中,如下所示:
[My text]
我想修改此行为,以便将其包装在左括号、空格、空格、右括号中,如下所示:(
[ My text ]
注意空格)。
我将如何改变这种行为?
我不介意仅在使用 Ruby on Rails 时修改它(即 .rb、.html.erb 文件范围等...),但如果它能在整个应用程序中生效,我更喜欢它。
谢谢你!
Please note that I did ask this on Super User and received absolutely no responses, so I decided to port this to a programming community that knows a lot more about TextMate.
Working in Ruby on Rails in TextMate, when I select a chunk of text, let's say
My text
and then hit the open bracket [
key on my keyboard, TextMate wraps the selected block in opening and closing brackets, as such:
[My text]
I'd like to modify this behavior so it wraps it in an opening bracket, space, space, closing bracket, as such:
[ My text ]
(mind the spaces).
How would I go about modifying this behavior?
I don't mind modifying it only while working for Ruby on Rails (i.e. .rb, .html.erb file scope etc...) but I'd prefer it if it would take effect throughout the application.
Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,我希望这比没有答案好。该行为由捆绑包控制。因此,您可以编辑相应的捆绑包以获得所需的行为。
这里引用了一段话:“某些默认项目可能并不符合您的喜好,例如片段中的编码风格可能与您的不同,因此您可能需要其他选项卡触发器、等效键或类似的修改。
如果您编辑默认项目,差异将存储在 ~/Library/Application Support/TextMate/Bundles 中。然后,它们会与默认版本合并,因此即使在升级 TextMate 后,您的更改也将有效。您创建的所有新项目也会出现在该位置。
通过将其拖动到 TextMate 或双击来安装的捆绑包或捆绑包项目将安装在 ~/Library/Application Support/TextMate/Pristine Copy/Bundles 中。编辑这些也会导致仅将差异存储在 ~/Library/Application Support/TextMate/Bundles 中,这意味着如果您稍后获得此第三方捆绑包的新版本,您可以安全地将其安装在旧版本之上(通过将其拖动到 TextMate),您的更改将再次被保留。
如果您想放弃本地更改,那么目前唯一的选择是从 ~/Library/Application Support/TextMate/Bundles 中删除这些更改。”
更多指针 转到此处。希望这会有所帮助。
Well i hope this is better than no answer. THe behaviour is controlled by a bundle. So you edit the respective bundle to get the behaviour you require.
Here is a quote "Some of the default items may not be to your exact liking, for example the coding style in snippets may differ from yours, so you may want other tab triggers, key equivalents, or similar modifications.
If you edit a default item the difference will be stored in ~/Library/Application Support/TextMate/Bundles. These are then merged with the default version so your changes will be effective even after upgrading TextMate. All new items you create also end up in this location.
Bundles or bundle items which you install by dragging them to TextMate or double clicking will be installed in ~/Library/Application Support/TextMate/Pristine Copy/Bundles. Editing these will also result in only the differences being stored in ~/Library/Application Support/TextMate/Bundles, meaning that if you later get a new version of this third party bundle, you can safely install this one on top of the old one (by dragging it to TextMate) and again your changes will be preserved.
If you want to discard local changes then currently the only option is to delete these from ~/Library/Application Support/TextMate/Bundles."
Fo more pointers go here. Hope this helps.