From 720658c0e5e9bb501aa474b1632abaaff839eab4 Mon Sep 17 00:00:00 2001 From: Sergey Avseyev Date: Wed, 13 Aug 2014 23:22:34 +0300 Subject: [PATCH] * modules/prelude-evil.el: keep selection after visual shift --- modules/prelude-evil.el | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/modules/prelude-evil.el b/modules/prelude-evil.el index ef57aee..d92a905 100644 --- a/modules/prelude-evil.el +++ b/modules/prelude-evil.el @@ -75,6 +75,23 @@ (define-key evil-normal-state-map (kbd "Y") 'prelude-yank-to-end-of-line) +(defun prelude-shift-left-visual () + "Shift left and restore visual selection." + (interactive) + (evil-shift-left (region-beginning) (region-end)) + (evil-normal-state) + (evil-visual-restore)) + +(defun prelude-shift-right-visual () + "Shift right and restore visual selection." + (interactive) + (evil-shift-right (region-beginning) (region-end)) + (evil-normal-state) + (evil-visual-restore)) + +(define-key evil-visual-state-map (kbd ">") 'prelude-shift-right-visual) +(define-key evil-visual-state-map (kbd "<") 'prelude-shift-left-visual) + ;; Scrolling (defun prelude-evil-scroll-down-other-window () (interactive)