about summary refs log tree commit diff stats
path: root/.emacs.d
diff options
context:
space:
mode:
authorDavid Morgan <djm_uk@protonmail.com>2021-09-09 16:45:49 +0100
committerDavid Morgan <djm_uk@protonmail.com>2021-09-09 16:45:49 +0100
commit85a47654f4c9f11eee94aa876375c13bfab5ca00 (patch)
tree55121cad8a7d52606caa7cffc15410f94f4c900a /.emacs.d
parent4334d0759064e2fad729b64a7d536ca3225aa772 (diff)
downloaddotfiles-85a47654f4c9f11eee94aa876375c13bfab5ca00.tar.gz
Re-add vertico-directory-slash
Diffstat (limited to '.emacs.d')
-rw-r--r--.emacs.d/lisp/init-minibuffer.el11
1 files changed, 9 insertions, 2 deletions
diff --git a/.emacs.d/lisp/init-minibuffer.el b/.emacs.d/lisp/init-minibuffer.el
index 1865921..d55dd86 100644
--- a/.emacs.d/lisp/init-minibuffer.el
+++ b/.emacs.d/lisp/init-minibuffer.el
@@ -91,8 +91,8 @@ DEFS is a plist associating completion categories to commands."
   (advice-add 'project-prompt-project-dir :around
               'read-project)
   (define-vertico-key "/"
-    'file #'vertico-directory-enter
-    'project-file #'vertico-directory-enter)
+    'file #'vertico-directory-slash
+    'project-file #'vertico-directory-slash)
   (define-vertico-key "RET"
     'file #'vertico-directory-enter-or-select-project
     'project-file #'vertico-directory-enter)
@@ -105,6 +105,13 @@ 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))