Last active
November 9, 2016 01:45
-
-
Save ShingoFukuyama/9564886 to your computer and use it in GitHub Desktop.
M-x my-helm-for-only-dir
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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