有任何 TextMate 技巧/捆绑包来查找 Rails 文档吗?
我知道这在“全功能”IDE 中很常见,而不是文本编辑器,但 TextMate 以其众多捆绑包走着独特的路线...我想知道是否有一种简单的方法,例如,单击 Ruby 或 Rails 类或方法并让 TextMate(或 shell)带我到定义或一些文档?
I know this is common in 'full featured' IDE's and not text editors but TextMate walks a unique line with its many bundles... I'm wondering if there is an easy way to, say, click on a Ruby or Rails class or method and have TextMate (or shell) take me to the definition or some documentation?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Rails 捆绑包 (
^h
) 中内置了一个,它使用 api 底座。另一种非常好的方法是使用 rails os x 字典< /a>,但它有一些缺点,我不确定它使用的是什么版本的 Rails(我很确定它不是 Rails 3,但我还没有检查过)。
There's one built into the rails bundle (
^h
) which uses api dock.Another pretty nice way of doing it is using the rails os x dictionary, but it has a few downsides and I'm not sure what version of rails it's using (I'm pretty sure it's not rails 3, but I haven't checked).
Ctrl-H 是了解 Ruby 或 Rails API 的绝佳选择。
但这不适用于项目中可能定义或包含的任何其他方法或类。对于那些我编写了一个 TextMate Bundle 命令(例如,您可以轻松地将其分配给 Ctrl+]),该命令查找插入符号下的类或方法的定义并将其显示在工具提示中,以及包含文件名和找到它的行。
看看:添加快捷方式TextMate 在工具提示中查找类或方法定义
希望您会发现它很有用;)
Ctrl-H is an excellent option to learn about Ruby or Rails API.
But this doesn't work for any other methods or class that may be defined or included in your project. For those I've written a TextMate Bundle command (you can easily assign it to Ctrl+] for example) that lookup for the definition of the class or method under the caret and displays it in a tooltip, along with the file name and the line where it was find.
Check it out: Add a shortcut to TextMate to lookup a class or method definition in a tooltip
Hope you'll find it useful ;)