  ;; Wrapping
  truncate-lines t
  truncate-partial-width-windows 50
+ ;; undo-tree
+ undo-tree-auto-save-history t
+ undo-tree-history-directory-alist (list (cons "." (concat doom-cache-dir "undo-tree-hist/")))
  visual-fill-column-center-text nil
- word-wrap t
  vc-follow-symlinks t)
 
-;; Ediff: use existing frame instead of creating a new one
-(add-hook! ediff-load
+;; ediff: use existing frame instead of creating a new one
+(add-hook! 'ediff-load-hook
   (setq ediff-diff-options           "-w"
         ediff-split-window-function  #'split-window-horizontally
         ediff-window-setup-function  #'ediff-setup-windows-plain)) ; no extra frames
 
-;; revert buffers for changed files
-(global-auto-revert-mode 1)
-(setq auto-revert-verbose nil)
-
-;; don't kill scratch buffers
 (defun doom|dont-kill-scratch-buffer ()
+  "Don't kill the scratch buffer."
   (or (not (string= (buffer-name) "*scratch*"))
       (ignore (bury-buffer))))
 (add-hook 'kill-buffer-query-functions #'doom|dont-kill-scratch-buffer)
-
-;; enabled by default in Emacs 25+. No thanks.
-(electric-indent-mode -1)
 
 (defun doom*delete-trailing-whitespace (orig-fn &rest args)
   "Don't affect trailing whitespace on current line."

      (buffer-disable-undo)
      (fundamental-mode))))
(add-hook 'find-file-hook #'doom|check-large-file)


;;


;; Branching & persistent undo
(def-package! undo-tree
  :demand t
  :config
  (defun doom*silent-undo-tree-load (orig-fn &rest args)
    "Silence undo-tree load errors."
    (quiet! (apply orig-fn args)))
  (advice-add #'undo-tree-load-history-hook :around #'doom*silent-undo-tree-load))


;;
