   ;; Undo-tree is too chatty about saving its history files. This doesn't
   ;; totally suppress it logging to *Messages*, it only stops it from appearing
   ;; in the echo-area.
-  (advice-add #'undo-tree-save-history :around #'doom-shut-up-a)
-
-  (global-undo-tree-mode +1))
+  (advice-add #'undo-tree-save-history :around #'doom-shut-up-a))

(use-package! undo-tree
  :when (featurep! +tree)
  ;; Branching & persistent undo
  :after-call doom-switch-buffer-hook after-find-file
  :config
  (setq undo-tree-visualizer-diff t
        undo-tree-auto-save-history t

              (define-key map (kbd "C-x r U") #'undo-fu-session-recover)
              map)
    :init-value nil
    :global t))


(use-package! undo-fu-session
