From d162a66b94857caf9709fb5723118f3bae123049 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Tue, 4 Apr 2017 22:08:32 +0200 Subject: [PATCH] Make slash complete directory names in helm-find-file --- init.el | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/init.el b/init.el index 0ae4817..2e1640c 100644 --- a/init.el +++ b/init.el @@ -77,7 +77,9 @@ (("M-x" . helm-M-x) :map ctl-x-map ("C-f" . helm-find-files) - ("b" . helm-mini))) + ("b" . helm-mini) + :map helm-map + ("/" . gpolonkai/helm-ff-slash-dir-complete))) (use-package helm-swoop :ensure t @@ -1195,3 +1197,11 @@ (abbreviate-file-name (buffer-file-name)) "%b"))))) + +(defun gpolonkai/helm-ff-slash-dir-complete () + (interactive) + (if (and (equal "Find Files" (assoc-default 'name (helm-get-current-source))) + (stringp (helm-get-selection)) + (file-directory-p (helm-get-selection))) + (helm-execute-persistent-action) + (insert "/")))