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 " 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.
In our opinion, Sublime text is best for normal text editing, and Vim is best for coding and documentation-related work.
Understanding vi editorSublime includes vim, which is an advanced section of vi editor, and includes customization of macros, snippets and plugins.
Sublime can be used on Linux, Windows and Mac as an IDE for developing Chromium. Here's what works: Editing code works well (especially if you're used to it and get used to the shortcuts). Navigating around the code works well.
To run code in Sublime Text, go to Tools > Build System, and select the language for your code (Sublime comes with support for various languages like Python, Ruby, Bash, and more). Next, press Cmd+B on Mac or Ctrl+B on Windows to run your code.
The TagList plugin is another (very popular) option. There are a bunch of others.
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.
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.
You can use my project https://github.com/fatih/subvim
For cmd+r
you can directly jump to any definition on the fly. No need to genarete tags or whatever. Currently any language supported by ctags can use this feature. I've also add languages like Go, Coffeescript, Objective-C,etc... It means just fire it up.
Also it has Sublime-like features backed in (means no plugins necessary). Thus you can use the following shortcuts:
cmd + p
-> go to anythingcmd + t
-> go to filecmd + r
-> go to symbolcmd + k
-> show side bar cmd + /
-> toggle commentcmd + [
-> indent cmd + ]
-> unindentcmd + <number>
-> jump to tab 1, tab 2, ...cmd + alt + left
-> move to next tabcmd + alt + right
-> move to previos tabcmd + z
-> undocmd + shift + z
-> redocmd + s
-> save filecmd + w
-> closecmd + f
-> searchAlso autocompletion, restoring latest session, automatic bracket closing and many minor changes make it really a joy to use.
The tagbar plugin works pretty well with Ruby files. Perhaps its not exactly the same as Sublime Super-R but it does give you a quick and easy way to explore a class.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With