On 18 Oct 2010, at 9:48 AM, Ben Fritz wrote:

> On Oct 17, 4:39 pm, Sung Pae <sung...@gmail.com> wrote:

>> For example, in Ruby one can assign the value of a `case' expression:
>> 
>>     myvar = case object
>>     when foo then bar
>>     when bar then baz
>>     end
>> 
>> This is my preferred indent style for this pattern, but vim defaults to
>> indenting it like this:
>> 
>>     myvar = case object
>>             when foo then bar
>>             when bar then baz
>>             end
> 
> 'cinoptions' only makes a difference if 'cindent' is set. In your
> case, it is more likely you are using filetype-specific indent rules.
> There MIGHT be variables you can set with a :let command that
> customize the indent rules to some extent, see the indent script in
> $VIMRUNTIME/indent/{filetype of interest}.vim. If there are no such
> options, you can make a copy of this file, place it in $HOME/.vim/
> indent or (on Windows systems $HOME/vimfiles/indent) and tweak to your
> liking.

Thank you for your response.

There is a separate indent file for ruby in VIMRUNTIME/indent, and the
one for JavaScript essentially just does "setlocal cindent". I hoped
that since the behavior is similar (unwanted indentation after an
assignment), there was a global switch to turn this sort of thing on
and off.

Oh well. I'm curious to know how other people on this list deal with
this issue, since the examples I gave are typical indent styles in the
Ruby and JS communities.

-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to