diff --git a/extensions/vi-mode/binds.lisp b/extensions/vi-mode/binds.lisp index c6dffc20c..906ef2e77 100644 --- a/extensions/vi-mode/binds.lisp +++ b/extensions/vi-mode/binds.lisp @@ -128,6 +128,7 @@ (define-key *normal-keymap* "g U" 'vi-upcase) (define-key *normal-keymap* "g u" 'vi-downcase) (define-key *normal-keymap* "g ~" 'vi-swapcase) +(define-key *normal-keymap* "~" 'vi-swapcase-and-forward-char) (define-key *normal-keymap* "u" 'vi-undo) (define-key *normal-keymap* "C-r" 'vi-redo) (define-key *motion-keymap* 'delete-previous-char 'vi-backward-char) diff --git a/extensions/vi-mode/commands.lisp b/extensions/vi-mode/commands.lisp index 0c8c50b15..fadeae2a2 100644 --- a/extensions/vi-mode/commands.lisp +++ b/extensions/vi-mode/commands.lisp @@ -90,6 +90,7 @@ :vi-upcase :vi-downcase :vi-swapcase + :vi-swapcase-and-forward-char :vi-undo :vi-redo :vi-record-macro @@ -639,6 +640,12 @@ Move the cursor to the first non-blank character of the line." (apply-visual-range #'swapcase-region) (swapcase-region start end)))) +(define-command vi-swapcase-and-forward-char () () + (let* ((start (copy-point (current-point))) + (end (character-offset (current-point) 1))) + (vi-swapcase start end (current-state))) + (vi-forward-char)) + (define-command vi-undo (&optional (n 1)) (:universal) (undo n))