emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/evil 51bd3c3315: Remove z kb macros for discoverability


From: ELPA Syncer
Subject: [nongnu] elpa/evil 51bd3c3315: Remove z kb macros for discoverability
Date: Sat, 15 Oct 2022 16:58:36 -0400 (EDT)

branch: elpa/evil
commit 51bd3c3315899e72b5c2014e2f920219b3faef93
Author: Tom Dalziel <tom_dl@hotmail.com>
Commit: Tom Dalziel <33435574+tomdl89@users.noreply.github.com>

    Remove z kb macros for discoverability
---
 evil-commands.el | 27 +++++++++++++++++++++++++++
 evil-maps.el     | 14 ++++++--------
 2 files changed, 33 insertions(+), 8 deletions(-)

diff --git a/evil-commands.el b/evil-commands.el
index 77ee4928c6..aefecc925d 100644
--- a/evil-commands.el
+++ b/evil-commands.el
@@ -1141,6 +1141,15 @@ If the scroll count is zero the command scrolls half the 
screen."
       (forward-line (1- count))))
   (recenter 0))
 
+(evil-define-command evil-scroll-line-to-top-first-non-blank (count)
+  "Scroll line number COUNT (or the cursor line) to the top of the window.
+Then move the cursor to the first non-blank character of that line."
+  :repeat nil
+  :keep-visual t
+  (interactive "<c>")
+  (evil-scroll-line-to-top count)
+  (evil-first-non-blank))
+
 (evil-define-command evil-scroll-line-to-center (count)
   "Scroll line number COUNT (or the cursor line) to the center of the window."
   :repeat nil
@@ -1152,6 +1161,15 @@ If the scroll count is zero the command scrolls half the 
screen."
       (forward-line (1- count))))
   (recenter))
 
+(evil-define-command evil-scroll-line-to-center-first-non-blank (count)
+  "Scroll line number COUNT (or the cursor line) to the center of the window.
+Then move the cursor to the first non-blank character of that line."
+  :repeat nil
+  :keep-visual t
+  (interactive "<c>")
+  (evil-scroll-line-to-center count)
+  (evil-first-non-blank))
+
 (evil-define-command evil-scroll-line-to-bottom (count)
   "Scroll line number COUNT (or the cursor line) to the bottom of the window."
   :repeat nil
@@ -1163,6 +1181,15 @@ If the scroll count is zero the command scrolls half the 
screen."
       (forward-line (1- count))))
   (recenter -1))
 
+(evil-define-command evil-scroll-line-to-bottom-first-non-blank (count)
+  "Scroll line number COUNT (or the cursor line) to the bottom of the window.
+Then move the cursor to the first non-blank character of that line."
+  :repeat nil
+  :keep-visual t
+  (interactive "<c>")
+  (evil-scroll-line-to-bottom count)
+  (evil-first-non-blank))
+
 (evil-define-command evil-scroll-bottom-line-to-top (count)
   "Scroll the line right below the window,
 or line COUNT to the top of the window."
diff --git a/evil-maps.el b/evil-maps.el
index 85e725b756..e15322aa80 100644
--- a/evil-maps.el
+++ b/evil-maps.el
@@ -299,12 +299,12 @@
 ;; TODO: z RET has an advanced form taking an count before the RET
 ;; but this requires again a special state with a single command
 ;; bound to RET
-(define-key evil-motion-state-map (vconcat "z" [return]) "zt^")
-(define-key evil-motion-state-map (kbd "z RET") (vconcat "z" [return]))
+(define-key evil-motion-state-map (vconcat "z" [return]) 
'evil-scroll-line-to-top-first-non-blank)
+(define-key evil-motion-state-map (kbd "z RET") 
'evil-scroll-line-to-top-first-non-blank)
 (define-key evil-motion-state-map "zz" 'evil-scroll-line-to-center)
-(define-key evil-motion-state-map "z." "zz^")
+(define-key evil-motion-state-map "z." 
'evil-scroll-line-to-center-first-non-blank)
 (define-key evil-motion-state-map "zb" 'evil-scroll-line-to-bottom)
-(define-key evil-motion-state-map "z-" "zb^")
+(define-key evil-motion-state-map "z-" 
'evil-scroll-line-to-bottom-first-non-blank)
 (define-key evil-motion-state-map "v" 'evil-visual-char)
 (define-key evil-motion-state-map "V" 'evil-visual-line)
 (define-key evil-motion-state-map "\C-v" 'evil-visual-block)
@@ -315,11 +315,9 @@
 (define-key evil-motion-state-map [up] 'evil-previous-line)
 (define-key evil-motion-state-map [down] 'evil-next-line)
 (define-key evil-motion-state-map "zl" 'evil-scroll-column-right)
-(define-key evil-motion-state-map [?z right] "zl")
+(define-key evil-motion-state-map [?z right] 'evil-scroll-column-right)
 (define-key evil-motion-state-map "zh" 'evil-scroll-column-left)
-(define-key evil-motion-state-map [?z left] "zh")
-(define-key evil-motion-state-map "zL" 'evil-scroll-right)
-(define-key evil-motion-state-map "zH" 'evil-scroll-left)
+(define-key evil-motion-state-map [?z left] 'evil-scroll-column-left)
 (define-key evil-motion-state-map
   (read-kbd-macro evil-toggle-key) 'evil-emacs-state)
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]