diff --git a/modules/editor/evil/config.el b/modules/editor/evil/config.el index f2bdbfd7c..19f759cdc 100644 --- a/modules/editor/evil/config.el +++ b/modules/editor/evil/config.el @@ -100,8 +100,12 @@ directives. By default, this only recognizes C directives.") (evil-set-cursor-color (get 'cursor 'evil-emacs-color))) ;; Ensure `evil-shift-width' always matches `tab-width'; evil does not police - ;; this itself, so we must. - (setq-hook! 'after-change-major-mode-hook evil-shift-width tab-width) + ;; this itself, so we must. Except in org-mode, where `tab-width' *must* + ;; default to 8, which isn't a sensible default for `evil-shift-width'. + (add-hook! 'after-change-major-mode-hook + (defun +evil-adjust-shift-width-h () + (unless (derived-mode-p 'org-mode) + (setq-local evil-shift-width tab-width)))) ;; --- keybind fixes ----------------------