From: "gsinclair@..." Date: 2005-05-24T18:10:17+09:00 Subject: Re: Vim's Ruby indenting Sam Roberts wrote: > Quoting gsinclair@gmail.com, on Tue, May 24, 2005 at 08:30:17AM +0900: > > To follow up Vincent's comments: to try your hand at this, there's no > > shortcut; just read the Vim help files on indenting and general Vim > > programming (it's fugly), and hack around with the existing > > highlighting code. I don't understand it myself. Indenting Ruby is > > Hard with a capital H. Writing the logic in the 10th-rate programming > > language that is VimScript (or whatever they call it) is insane, but > > Nikolai has done a great job. > > I wonder whether using Syntax, based on the ruby parser, would allow an > external tool to be written (in ruby...) that would do better. Down side > is it wouldn't indent as you type, upside is you could set indentprg, > and run the whole file through it. I've proposed a few times that someone write an external indenting tool in Ruby, but no-one's done it, or even tried, AFAIK. Two upsides that you didn't mention: once it's (nearly) perfect, it can be translated into any editor-specific language; and you could use Vim's embedded-Ruby capability to actually use the Ruby code to indent as you type. Getting the indenting logic right is the hard part, and we all that requires using Ruby! Cheers, Gavin