vim/macvim:定位方法/符号的定义位置

发布于 2024-09-12 05:24:49 字数 128 浏览 1 评论 0原文

我的大部分 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 技术交流群。

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

发布评论

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

评论(1

时光无声 2024-09-19 05:24:49

我建议使用 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/

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