dart-lang/dart-vim-plugin

indent more like official code

dengcqw opened this issue · 2 comments

set cinoptions=j1,J1,(2,m1

We already use j1,J1

setlocal cinoptions+=j1,J1

Definitely agree with adding m1.

I don't think we want (2 - from the samples I'm testing we get results closer to dartfmt with (2s,u2s,U1. The first (2s is technically the default but we may as well include it for clarity.

While I'm looking at this we probably also want +2s for statement continuations.

Note that you'll want let g:dart_style_guide = v:true for the best effect since it sets shiftwidth for you.

Ah, so one thing that makes this interesting, if you're using a trailing comma in an argument list then the (2,or (s, does behave closer to dartfmt...