Skip to content

Instantly share code, notes, and snippets.

@ShingoFukuyama
Last active November 9, 2016 01:45
Show Gist options
  • Save ShingoFukuyama/9564886 to your computer and use it in GitHub Desktop.
Save ShingoFukuyama/9564886 to your computer and use it in GitHub Desktop.
M-x my-helm-for-only-dir
(defun my-helm-for-only-dir ($query)
(interactive "sDir name: ")
(helm :sources
`((name . "helm for directory")
(candidates . (lambda ()
(split-string
(shell-command-to-string
(format "find `pwd -P` -type d | grep '%s'" $query)))))
(action . (lambda ($cand)
(if (file-directory-p $cand)
(dired $cand)
(message "It's not a directory")))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment