From 8850ef889b4a6dc235a87b5f0df04f74661524a1 Mon Sep 17 00:00:00 2001 From: LeeLaffan Date: Tue, 24 Dec 2024 10:52:31 +0000 Subject: [PATCH] Add g^, g0, g$ These use the move-to-(beginning/end)-of-line. The equivilent to the regular ^ or $ would be move-to-(beginning/end)-of-logical-line There is also a variable marked as ignored when it is used. --- extensions/vi-mode/binds.lisp | 3 +++ extensions/vi-mode/ex-command.lisp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/extensions/vi-mode/binds.lisp b/extensions/vi-mode/binds.lisp index 1954f9eaf..be10e0ace 100644 --- a/extensions/vi-mode/binds.lisp +++ b/extensions/vi-mode/binds.lisp @@ -39,6 +39,9 @@ (define-key *motion-keymap* "B" 'vi-backward-word-begin-broad) (define-key *motion-keymap* "e" 'vi-forward-word-end) (define-key *motion-keymap* "E" 'vi-forward-word-end-broad) +(define-key *motion-keymap* "g ^" 'move-to-beginning-of-line) +(define-key *motion-keymap* "g 0" 'move-to-beginning-of-line) +(define-key *motion-keymap* "g $" 'move-to-end-of-line) (define-key *motion-keymap* "$" 'vi-move-to-end-of-line) (define-key *motion-keymap* "g _" 'vi-move-to-last-nonblank) (define-key *motion-keymap* "H" 'vi-move-to-window-top) diff --git a/extensions/vi-mode/ex-command.lisp b/extensions/vi-mode/ex-command.lisp index 52fab719c..f67d9aef2 100644 --- a/extensions/vi-mode/ex-command.lisp +++ b/extensions/vi-mode/ex-command.lisp @@ -67,7 +67,7 @@ (lem-vi-mode/commands:vi-window-split-vertically-new 1 filename)) (define-ex-command "^vne(?:w)?$" (range filename) - (declare (ignore range filename)) + (declare (ignore range)) (lem-vi-mode/commands:vi-window-split-horizontally-new 1 filename)) (define-ex-command "^ene(?:w)?$" (range filename)