diff options
author | David Morgan <djm_uk@protonmail.com> | 2024-09-30 13:25:00 +0100 |
---|---|---|
committer | David Morgan <djm_uk@protonmail.com> | 2024-09-30 13:25:00 +0100 |
commit | f022aa9b42cc5c3147bef85fa900da480f4b364f (patch) | |
tree | 041cef5727ee8191f839cb67aad289404069bb4d /.emacs.d | |
parent | 1d24ea84eb86752a1032e1a90f7e9d07a157a256 (diff) | |
download | dotfiles-f022aa9b42cc5c3147bef85fa900da480f4b364f.tar.gz |
Add inserted file candidates to minibuffer history
Diffstat (limited to '.emacs.d')
-rw-r--r-- | .emacs.d/lisp/init-minibuffer.el | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/.emacs.d/lisp/init-minibuffer.el b/.emacs.d/lisp/init-minibuffer.el index 6e6d515..08ce74a 100644 --- a/.emacs.d/lisp/init-minibuffer.el +++ b/.emacs.d/lisp/init-minibuffer.el @@ -74,6 +74,14 @@ (select-window (minibuffer-selected-window)) (select-window (active-minibuffer-window)))) + ;; Modified from https://github.com/minad/vertico/wiki#update-minibuffer-history-with-candidate-insertions + (defadvice vertico-insert + (after vertico-insert-add-history activate) + "Make vertico-insert add to the minibuffer history." + (if (and (not (eq minibuffer-history-variable t)) + (eq 'file (vertico--metadata-get 'category))) + (add-to-history minibuffer-history-variable (minibuffer-contents)))) + ;; https://github.com/minad/vertico/wiki#customize-sorting-based-on-completion-category (defun sort-directories-first (files) ;; Still sort by history position, length and alphabetically |