Hi,

I'd like to have C indentation as shown below:

void function()
        {
        switch (x)
                {

        case a:
                {
                }
        case b:
                {
                }

                }
        }

And this is what I've in one of the sourced .vim files:

" Indent for function braces too
setl cinoptions=f1s
" Put { 'shiftwidth' away from the current indent
setl cinoptions+={1s
" Case statements have to have a -ve indent!
setl cinoptions+=:-0
" C++ scope statements too to have -ve indent!
setl cinoptions+=g-
" Don't expand tabs
setl noexpandtab
" Set shiftwidth to the default, i.e. 8
setl shiftwidth&vim
" Set soft tab equal to that of tabstop
execute "setl softtabstop=" . &tabstop

However, when I type do a = command, what I get is:

void function()
        {
        switch (x)
                {

        case a:
                        {
                        }
        case b:
                        {
                        }

                }
        }

I.e. the block after case has an extra indentation. Could somebody
suggest necessary correction to the 'cino' please?

Thanks in advance
:J

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

Reply via email to