Created
September 21, 2018 23:06
-
-
Save jcf/229c5ee9c408beba031b1b4374387a2f to your computer and use it in GitHub Desktop.
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 eshell/j (&rest query) | |
(require 's) | |
(let* ((fasd (executable-find "fasd")) | |
(matches (thread-last (s-join " " query) | |
(format "%s -ld %s" fasd) | |
(shell-command-to-string) | |
(s-trim) | |
(s-lines) | |
(mapcar 's-trim)))) | |
(message "Matches: %s" matches) | |
(when-let (dir (first matches)) | |
(eshell/cd dir)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment