From 2c956593cfa2811b91a6f077006b08a38fef28e7 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 4 Aug 2018 16:00:11 +0200 Subject: [PATCH] completion/helm: don't index HOME Invoke helm-find-files instead --- modules/completion/helm/autoload/helm.el | 12 ++++++++++++ modules/completion/helm/config.el | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/modules/completion/helm/autoload/helm.el b/modules/completion/helm/autoload/helm.el index 0c1ec29b5..6e44f4a32 100644 --- a/modules/completion/helm/autoload/helm.el +++ b/modules/completion/helm/autoload/helm.el @@ -6,6 +6,18 @@ ;; TODO Implement `+helm/tasks' (error "Not implemented yet")) +;;;###autoload +(defun +helm/projectile-find-file () + "Call `helm-find-files' if called from HOME, otherwise +`helm-projectile-find-file'." + (interactive) + (call-interactively + (if (or (file-equal-p default-directory "~") + (when-let* ((proot (doom-project-root 'nocache))) + (file-equal-p proot "~"))) + #'helm-find-files + #'helm-projectile-find-file))) + ;; ;; Project search diff --git a/modules/completion/helm/config.el b/modules/completion/helm/config.el index 0b126187a..1834a78fb 100644 --- a/modules/completion/helm/config.el +++ b/modules/completion/helm/config.el @@ -30,7 +30,7 @@ If you want to already use git-grep or grep, set this to nil.") [remap imenu-anywhere] #'helm-imenu-anywhere [remap imenu] #'helm-semantic-or-imenu [remap noop-show-kill-ring] #'helm-show-kill-ring - [remap projectile-find-file] #'helm-projectile-find-file + [remap projectile-find-file] #'+helm/projectile-find-file [remap projectile-recentf] #'helm-projectile-recentf [remap projectile-switch-project] #'helm-projectile-switch-project [remap projectile-switch-to-buffer] #'helm-projectile-switch-to-buffer