From: Ryan Leavengood Date: 2005-04-27T03:40:17+09:00 Subject: Re: Folding editor for ruby code browsing Andrew Walrond wrote: > On Tuesday 26 April 2005 17:30, Ryan Leavengood wrote: > >>Ctrl-] >> > > > How can I generate tags for ruby code? Is it possible? Apparently Exuberant Ctags (http://ctags.sourceforge.net) supports Ruby, though I haven't used it yet for Ruby (only for Java, my language for work.) But there are some flaws in the Ruby support, as described here (toward the bottom): http://rubygarden.org/ruby?VimRubySupport Also another Vim command related to tags that I actually use more than Ctrl-] is g], which lists all tags matching what is under the cursor. In the Java code I work with there are usually a lot of methods named the same in various places, so this allows navigating to all those methods. It isn't exactly Eclipse with full code-completion and navigation support, but it isn't too bad (and Vim is certainly a smaller memory footprint ;) Speaking of Eclipse, there is a Ruby development plugin, but I haven't used it much yet, so I don't know how many of the Java features you get with Eclipse also work with Ruby. Finally, another Vim "feature" that I can't live without is the "sort-of" code completion you get with Ctrl-N and Ctrl-P, which can be turned into tab completion by adding this to your vimrc: " Make tab do completion in certain cases function! InsertTabWrapper(direction) let col = col('.') - 1 if !col || getline('.')[col - 1] !~ '\k' return "\" elseif "backward" == a:direction return "\" else return "\" endif endfunction inoremap =InsertTabWrapper ("forward") inoremap =InsertTabWrapper ("backward") Ryan Leavengood