How to disable vim's indentation of switch case?

前端 未结 3 2037
夕颜
夕颜 2021-02-07 02:49

I\'m currently fighting with Vim, I can\'t seem to make the indentation options do what I want.

Here are my settings, I put them at the bottom of .vimrc to make sure the

3条回答
  •  死守一世寂寞
    2021-02-07 03:16

    If indent is N spaces (replace N with actual value), try the following

    set cinoptions=p0,t0,:N,=0
    set cinwords=if,else,switch,case,for,while,do
    set cindent
    

    :N -> place 'case' label 0 characters from switch's indent

    =0 -> indents the statements within case label

提交回复
热议问题