Vim中类似Sublime代码的方法浏览器 [英] Sublime code-like method browser in Vim
问题描述
Sublime代码具有Super-R快捷方式,该快捷方式可打开方法浏览器,列出当前类(Ruby)中的所有方法。
Sublime code has a shortcut Super-R which opens a method browser listing all methods in current class (Ruby). Is there a plugin to get similar functionality in Vim?
/ def或 m]仅在您熟悉类并知道使用哪种方法的情况下才能工作
"/def " or "m]" work only if you're familiar with the class and know what method you want to go to, whereas Super+R works for just exploring a class.
推荐答案
TagList 插件是另一个(非常受欢迎)的选项。有很多其他。
The TagList plugin is another (very popular) option. There are a bunch of others.
仅供参考, / def
和 m]
不是Sublime Text的 Ctrl + R 的等效项。那就是:tag foo
,如果您不知道所有方法的名称,都可以使用Tab键完成。
FYI, /def
and m]
are not the equivalent of Sublime Text's Ctrl+R. That would be :tag foo
which you can tab-complete if you don't know all the names of your methods.
在此过程中, CtrlP 插件具有与Sublime Text的功能非常相似的功能 Ctrl + R ::CtrlpBufTag
我每天使用数百次。
While we are at it, the CtrlP plugin has a feature very similar to Sublime Text's Ctrl+R: :CtrlpBufTag
that I use hundreds of times a day.
所有这些方法取决于
All of these methods depend on the presence of a tags
file generated by Exuberant Ctags or some compatible program. Actually, tags are quite an important part of the Vim experience.
这篇关于Vim中类似Sublime代码的方法浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!