aboutsummaryrefslogtreecommitdiff
path: root/evil-vars.el
diff options
context:
space:
mode:
authorYunhao Zhao <yunhaozhaots@gmail.com>2019-06-13 14:07:06 +0800
committerEivind Fonn <evfonn@gmail.com>2019-12-19 10:49:44 +0100
commit33bb8534f6f8d12ae071cb12a38db6306cb07f87 (patch)
tree2fddbd91360cc72bd89f7f951bbcf18028165fc2 /evil-vars.el
parent36d4cfb5919d2b7c6c24478ef62d0820a5590b72 (diff)
Add evil-want-C-u-delete option
Diffstat (limited to 'evil-vars.el')
-rw-r--r--evil-vars.el16
1 files changed, 16 insertions, 0 deletions
diff --git a/evil-vars.el b/evil-vars.el
index 7a0c794..62e1e2d 100644
--- a/evil-vars.el
+++ b/evil-vars.el
@@ -456,6 +456,22 @@ replicates the default vim behavior."
(not (lookup-key evil-motion-state-map (kbd "C-d"))))
(define-key evil-motion-state-map (kbd "C-d") 'evil-scroll-down))))))
+(defcustom evil-want-C-u-delete nil
+ "Whether \"C-u\" deletes back to indentation in Insert state."
+ :type 'boolean
+ :group 'evil
+ :set #'(lambda (sym value)
+ (set-default sym value)
+ (when (boundp 'evil-insert-state-map)
+ (cond
+ ((and (not value)
+ (eq (lookup-key evil-insert-state-map (kbd "C-u"))
+ 'evil-delete-back-to-indentation))
+ (define-key evil-insert-state-map (kbd "C-u") nil))
+ ((and value
+ (not (lookup-key evil-insert-state-map (kbd "C-u"))))
+ (define-key evil-insert-state-map (kbd "C-u") 'evil-delete-back-to-indentation))))))
+
(defcustom evil-want-C-w-delete t
"Whether \"C-w\" deletes a word in Insert state."
:type 'boolean