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 ?

1 Answer 1

1

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
  • 1
    Mark your own answer as a solution if it solved your problem.
    – user12563
    Jul 19, 2018 at 17:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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