2009/3/12 Ben Schmidt <[email protected]>:
>
>> Yes, but it's clearer (to me) than
>>
>> for (;;)
>> {CallFunction();}
>
> It looks like you resort to:
>
> func! MyCindent(l)
>   let extra = match(getline(prevnonblank(a:l-1)),'^\s*{.*}$')==-1?0:-&sw
>   let extra += match(getline(a:l),'^\s*{.*}$')==-1?0:&sw
>   return cindent(a:l)+extra
> endfunc
> :let &l:indentexpr='MyCindent(v:lnum)'
> :setlocal cinkeys+=}
>
> Ben.

This looks really good, thank you!  Is there any way to make it indent
when the '}' is typed?  I thought that this should happen with

:setlocal cinkeys+=}

but it doesn't seem to happen.  If I hit gg=G, the indentation is correct.

My cinkeys is:

0{,0},0),:,0#,!^F,o,O,e,}

Many thanks for the help,

Al

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to