I'm a bit confused about setting indentation for different modes in Emacs.
- It seems you have to explicitly set indentation for each mode
- Some modes use
setq-default, some use
setqand some use
- Indentation variables are inconsistently named
Is there a single indentation variable I can set that all modes inherit as a default?
If not, is there a shorter and more correct way to set up my indentation than listed below?
(setq-default tab-width 2) (setq-default sh-basic-offset 2) (setq-default sh-indentation 2) ;; workaround for bug in 25.3.1 (setq c-basic-offset 2 css-indent-offset 2 js-indent-level 2) (add-hook 'php-mode-hook '(lambda () (setq c-basic-offset 2))) (add-hook 'ess-mode-hook '(lambda () (setq ess-indent-offset 2)))