diff options
| author | Nathan Gass <gass@search.ch> | 2020-01-05 22:00:20 +0100 |
|---|---|---|
| committer | Eivind Fonn <evfonn@gmail.com> | 2020-01-28 16:14:06 +0100 |
| commit | 94af4eafacb6b4664be75722f6f04ed65c8a5ef3 (patch) | |
| tree | 21dad40c171e3f44631b7d08d0c0e62240015c10 /evil-ex.el | |
| parent | dee23238d32b25906f9a456edeec510238406a4d (diff) | |
Implement Vim Ctrl-f in minibuffer.
Open apropriate command windows for Ctrl-f while in minibuffer for an ex command
or a search. As all ways to abort a minibuffer do not return and restore the
active buffer, we have to set the content of the minibuffer and exit normally to
trigger the apropriate action. Also restoring the window configuration is
necessary so minibuffer-selected-window is not changed.
Diffstat (limited to 'evil-ex.el')
| -rw-r--r-- | evil-ex.el | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -222,6 +222,24 @@ Otherwise behaves like `delete-backward-char'." (unless (minibufferp) (abort-recursive-edit))) +(defun evil-ex-command-window () + "Start command window with ex history and current minibuffer content." + (interactive) + (let ((current (minibuffer-contents)) + (config (current-window-configuration))) + (evil-ex-teardown) + (select-window (minibuffer-selected-window) t) + (evil-command-window (cons current evil-ex-history) + ":" + (apply-partially 'evil-ex-command-window-execute config)))) + +(defun evil-ex-command-window-execute (config result) + (select-window (active-minibuffer-window) t) + (set-window-configuration config) + (delete-minibuffer-contents) + (insert result) + (exit-minibuffer)) + (defun evil-ex-setup () "Initialize Ex minibuffer. This function registers several hooks that are used for the |
