about summary refs log tree commit diff stats
path: root/.emacs.d
diff options
context:
space:
mode:
Diffstat (limited to '.emacs.d')
-rw-r--r--.emacs.d/lisp/init-completion.el7
1 files changed, 7 insertions, 0 deletions
diff --git a/.emacs.d/lisp/init-completion.el b/.emacs.d/lisp/init-completion.el
index a1f0449..a3b8c71 100644
--- a/.emacs.d/lisp/init-completion.el
+++ b/.emacs.d/lisp/init-completion.el
@@ -165,10 +165,17 @@
              (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
   :bind (:map vertico-map
               ("RET" . vertico-directory-enter)
               ("/" . vertico-directory-slash)
+              ("~" . vertico-directory-home)
               ("DEL" . vertico-directory-delete-char)
               ("M-DEL" . vertico-directory-delete-word))
   ;; Tidy shadowed file names