From: "gsinclair@..." Date: 2005-05-24T08:30:17+09:00 Subject: Re: Vim's Ruby indenting Brian Schr�der wrote: > > I like this kind of code. > > a = case b > when 1: 10 > when 2: 20 > else 50 > end > > makes it clear that something is assigned to a. While > > case b > when 1: a = 10 > when 2: a = 20 > else a = 50 > end > > does not make this important fact as clear on first sight. The following code indents properly and is what I use. a = case b when 1: 10 when 2: 20 else 50 end 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 doubt it will ever improve to the point that gg=G is advisable on a large file, though. I always indent one unit-of-code (e.g. block/method/class) at a time. Cheers, Gavin