vim/macvim:定位方法/符号的定义位置
我的大部分 Ruby + Ruby on Rails 开发都使用 macvim/vim。目前是否有一种方法可以跳转到项目中定义方法的位置,即使它与调用它的位置不在同一文件中?无论是与语言无关的方式还是 Ruby/Rails 特定的方式都有效。
I'm using macvim/vim for most of my Ruby + Ruby on Rails development. Is there currently a way to jump to where a method was defined within a project, even if it's not in the same file as where it's being invoked? Either a language agnostic way or a Ruby/Rails specific way works.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议使用 ctags 插件,Bryan Liles 制作了一个关于如何在 Rails 开发中使用它的精彩截屏视频。
http://smartic.us/2009/04/05/using- ctags-in-vim/
来自他的页面:
不那么完整的备忘单:
^] – 查找标签
^T – 向后退
:tags – 显示您去过的地方
:tag – 转到标签中的某个位置stack
:tselect 或 g] – 显示引用某些内容的位置
^W-] – 在分割窗口中查找标签
您还可以通过运行以下命令查看 vim 帮助: help :tags
编辑:
这是一个关于更新您的内容的精彩截屏视频自动标记文件 http://smartic.us/2009/04 /03/创建-ctags-with-git-hooks/
I recommend using the ctags plugin, Bryan Liles put together a nice screencast on how to use it with rails development.
http://smartic.us/2009/04/05/using-ctags-in-vim/
From his page:
Not-so-complete cheat sheet:
^] – find a tag
^T – go backwards
:tags – show where you’ve been
:tag – go somewhere in your tag stack
:tselect or g] – show where something is referenced
^W-] – find a tag in a split window
You can also have a look at the vim help by running: help :tags
EDIT:
Here is a nice screencast on updating your tags file automatically http://smartic.us/2009/04/03/creating-ctags-with-git-hooks/