I'd like tab-width
to be set to 2 in all programming modes. I use prelude
(which might be one of the problems), but I have this in my custom.el
(which is sort of the analogue to .emacs
):
(setq my-tab-width 2)
(setq standard-indent my-tab-width)
(setq tab-width my-tab-width)
(setq c-basic-offset my-tab-width)
(setq js2-basic-offset my-tab-width)
(setq web-mode-attr-indent-offset my-tab-width)
(setq web-mode-code-indent-offset my-tab-width)
(setq web-mode-css-indent-offset my-tab-width)
How can I avoid all the duplication?