aboutsummaryrefslogtreecommitdiff
path: root/evil-integration.el
diff options
context:
space:
mode:
authorFrank Fischer <frank-fischer@shadow-soft.de>2014-01-05 09:53:50 +0100
committerFrank Fischer <frank-fischer@shadow-soft.de>2014-01-05 09:53:50 +0100
commit21aa906fda93739f56bdbb5e4346ffc1f2fc8403 (patch)
tree82a5e4ab100d72825c48578e58b0ae72dfd52cef /evil-integration.el
parent766239283ee264040648d264bb6743514215cf66 (diff)
parenta64928c017683d96eff3c2529a05b022c8ee89d7 (diff)
merge stable-1.0
Diffstat (limited to 'evil-integration.el')
-rw-r--r--evil-integration.el17
1 files changed, 16 insertions, 1 deletions
diff --git a/evil-integration.el b/evil-integration.el
index 12540a0..5491960 100644
--- a/evil-integration.el
+++ b/evil-integration.el
@@ -206,7 +206,22 @@
"k" 'evil-previous-line
"RET" 'ibuffer-visit-buffer)))
-;;; Undo tree visualizer
+;;; Undo tree
+(when (and (require 'undo-tree nil t)
+ (fboundp 'global-undo-tree-mode))
+ (global-undo-tree-mode 1))
+
+(defun evil-turn-on-undo-tree-mode ()
+ "Enable `undo-tree-mode' if evil is enabled.
+This function enables `undo-tree-mode' when Evil is activated in
+some buffer, but only if `global-undo-tree-mode' is also
+activated."
+ (when (and (boundp 'global-undo-tree-mode)
+ (fboundp 'undo-tree-mode)
+ global-undo-tree-mode)
+ (undo-tree-mode 1)))
+
+(add-hook 'evil-local-mode-hook #'evil-turn-on-undo-tree-mode)
(defadvice undo-tree-visualize (after evil activate)
"Initialize Evil in the visualization buffer."