From: Kirk Haines Date: 2005-10-10T11:35:41+09:00 Subject: Re: indent for Ruby, to reformat it On Sunday 09 October 2005 7:01 pm, Gavin Sinclair wrote: > Kirk Haines wrote: > > I use vim a lot, but have never asked it to indent my code for me. And > > judging by the results that I just got, I won't do so again any time > > soon. At least on my machine, with what is, admittedly, probably old and > > outdated Ruby support, the results are awful. > > With a modern setup, bad results are an exception rather than a rule. Okay. After spending some time with it, here's the secret: Download a recent version of vim-ruby from Rubyforge: http://rubyforge.org/frs/?group_id=16&release_id=3083 Follow the instructions found there or on the vim-ruby page: http://vim-ruby.rubyforge.org to install, and then make sure your .vimrc is setup to make use of what you just installed. The last bit is important. Otherwise, you get really nasty looking indentation. After having followed those steps, the indentation looks pretty good. I've tested it on half a dozen files of varying lengths and code complexities, and it seems to do what it should. Kirk Haines