Adapting swich-case indentation

"[email protected]" <[email protected]>
Newsgroups gmane.editors.vim
Message-ID <[email protected]>
Is there a way to bend Vim to my will in indenting C switch-case statements 
with local scopes delimited by braces.  Here's what I mean: (Vim 9.1 on 
MacOS (M2 chip and Intel x86-64)  
int main() {
    int n = 42;
    switch (n) {
        case 42: {
            int twice = 2*n;
        }        
    }
}

The above example illustrates what I want:.  But when I visual-select those 
lines and press =. I get this:
int main() {
    int n = 42;
    switch (n) {
        case 42: {
                     int twice = 2*n;
                 }
    }

The compiler insists on the braces because of that local int twice 
variable;   putting the opening brace of the case: on its own line helps, 
but then I have a deviation from my preferred style.  

Please note that this example is contrived to illustrate the problem, not 
an excerpt from  an actual program..

Am I just finally asking too much of Vim?

-- 
-- 
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

--- 
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/e1c52cd7-710b-4d27-a4cb-c601b3f3fa80n%40googlegroups.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.