diff --git a/extensions/vi-mode/binds.lisp b/extensions/vi-mode/binds.lisp index 722d7c837..ca67e1cea 100644 --- a/extensions/vi-mode/binds.lisp +++ b/extensions/vi-mode/binds.lisp @@ -8,7 +8,10 @@ :lem-vi-mode/ex :lem-vi-mode/visual) (:import-from :lem-core - :keymap-table)) + :keymap-table) + (:import-from :lem/prompt-window + :prompt-previous-history + :prompt-next-history)) (in-package :lem-vi-mode/binds) (define-key *motion-keymap* "0" 'vi-move-to-beginning-of-line/universal-argument-0) @@ -138,6 +141,9 @@ (define-key *replace-state-keymap* "C-g" 'escape) (define-key *replace-state-keymap* "Escape" 'escape) +(define-key *ex-keymap* "C-p" 'prompt-previous-history) +(define-key *ex-keymap* "C-n" 'prompt-next-history) + (define-key *outer-text-objects-keymap* "w" 'vi-a-word) (define-key *inner-text-objects-keymap* "w" 'vi-inner-word) (define-key *outer-text-objects-keymap* "\"" 'vi-a-double-quote) diff --git a/extensions/vi-mode/ex.lisp b/extensions/vi-mode/ex.lisp index cf192a6e6..9812522ec 100644 --- a/extensions/vi-mode/ex.lisp +++ b/extensions/vi-mode/ex.lisp @@ -8,7 +8,8 @@ :vi-visual-end) (:import-from :lem-vi-mode/utils :expand-filename-modifiers) - (:export :vi-ex)) + (:export :vi-ex + :*ex-keymap*)) (in-package :lem-vi-mode/ex) (defvar *ex-keymap* (make-keymap :name '*ex-keymap*)) @@ -73,7 +74,8 @@ :end (line-end e))))) (lem/completion-mode::completion-buffer comp-str)))))) - :history-symbol 'vi-ex)))))) + :history-symbol 'vi-ex + :special-keymap *ex-keymap*)))))) (defun execute-ex (string) (let ((lem-vi-mode/ex-core:*point* (current-point)))