Fork me on GitHub
#spacemacs
<
2022-09-13
>
jumar05:09:41

I have this in my spacemacs file but yet when I press , = = my HTML (and JS files) still get reformatted to use 4 spaces.

(setq js2-basic-offset 2)
  (setq js-indent-level 2)
  (setq css-indent-offset 2)
  (setq web-mode-markup-indent-offset 2)
  (setq web-mode-css-indent-offset 2)
  (setq web-mode-code-indent-offset 2)
  (setq web-mode-attr-indent-offset 2)
This works as expected when I'm just typing the code into the buffer and pressing enter. I think this is because spacemacs uses html-beautify program to do the formatting which by default uses 4 spaces. How can I make this consistent with my settings?

jumar05:09:48

If I do this it works but it is cumbersome:

(setq web-beautify-args '("-s 2" "-f" "-"))