mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
fix(evil): don't auto-set evil-shift-width in org-mode
org-mode requires `tab-width` be 8, which is not a sensible default for `evil-shift-width`, so let it fall back to its default value (which is 4) in org buffers.
This commit is contained in:
@ -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 ----------------------
|
||||
|
Reference in New Issue
Block a user