1

In web-mode, the indentation after "."

var context = cubism.context()
                    .step(1e4)
                    .size(+d33.select("#using-cubism2")
                              .style("width")
                              .slice(0,-2));

I want to look like of js2-mode

var context = cubism.context()
    .step(1e4)
    .size(+d33.select("#using-cubism2")
          .style("width")
          .slice(0,-2));

Can I do this ?

0

I can find the variable 'web-mode-indenation-params' from the source code of web-mode. Then also can find the manual from the official site

You can disable arguments|concatenation|calls lineup with
(add-to-list 'web-mode-indentation-params '("lineup-args" . nil))
(add-to-list 'web-mode-indentation-params '("lineup-calls" . nil))
(add-to-list 'web-mode-indentation-params '("lineup-concats" . nil))
(add-to-list 'web-mode-indentation-params '("lineup-ternary" . nil))

Finally following solves my problem.

(add-to-list 'web-mode-indentation-params '("lineup-calls" . nil))
  • 1
    Mark your own answer as a solution if it solved your problem. – DoMiNeLa10 Jul 19 '18 at 17:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.