From 57b36ca772f8f3a03345af1def4f78dd5c21d629 Mon Sep 17 00:00:00 2001 From: David Morgan Date: Tue, 12 Oct 2021 06:38:27 +0100 Subject: Ensure vertico directory commands are loaded --- .emacs.d/lisp/init-minibuffer.el | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.emacs.d/lisp/init-minibuffer.el b/.emacs.d/lisp/init-minibuffer.el index 57f617c..fa9e60f 100644 --- a/.emacs.d/lisp/init-minibuffer.el +++ b/.emacs.d/lisp/init-minibuffer.el @@ -85,6 +85,19 @@ DEFS is a plist associating completion categories to commands." (if switching-project (vertico-exit) (vertico-directory-enter))) + (defun vertico-directory-slash () + (interactive) + (if (and (>= vertico--index 0) + (string-suffix-p "/" (vertico--candidate)) + (vertico-directory--completing-file-p)) + (vertico-insert) + (insert "/"))) + (defun vertico-directory-home () + (interactive) + (if (and (string-suffix-p "/" (vertico--candidate)) + (vertico-directory--completing-file-p)) + (insert "~/") + (insert "~"))) (defun read-project (orig &rest args) (let ((switching-project t)) (apply orig args))) @@ -105,21 +118,8 @@ DEFS is a plist associating completion categories to commands." 'file #'vertico-directory-delete-word 'project-file #'vertico-directory-delete-word) :config - (defun vertico-directory-slash () - (interactive) - (if (and (>= vertico--index 0) - (string-suffix-p "/" (vertico--candidate)) - (vertico-directory--completing-file-p)) - (vertico-insert) - (insert "/"))) - (defun vertico-directory-home () - (interactive) - (if (and (string-suffix-p "/" (vertico--candidate)) - (vertico-directory--completing-file-p)) - (insert "~/") - (insert "~"))) :load-path vertico-extensions-dir - :commands vertico-directory-enter + :commands (vertico-directory-enter vertico-directory-delete-word vertico-directory-delete-char) ;; Tidy shadowed file names :hook (rfn-eshadow-update-overlay . vertico-directory-tidy)) -- cgit 1.4.1-2-gfad0