Preconfigured ‘helm’ for the find shell command
I need the same functionality with ivy/counsel.
Emacs Stack Exchange is a question and answer site for those using, extending or developing Emacs. It only takes a minute to sign up.Sign up to join this community
Maybe something like:
(ivy-read "File: " (directory-files-recursively default-directory ""))
You might also try this (adapted from http://oremacs.com/swiper/#example---counsel-locate):
(defun counsel-find-function (str) (if (< (length str) 3) (counsel-more-chars 3) (let ((cmd (format "find %s ! -readable -prune -o -iname \"%s*\" -print" ; NOTE: some versions of `find' may require parentheses, ; like this: \( ! -readable -prune \) default-directory (counsel-unquote-regex-parens (ivy--regex str))))) (message "%s" cmd) (counsel--async-command cmd)) '("" "working..."))) ;;;###autoload (defun counsel-find (&optional initial-input) "Use GNU find, counsel and ivy to present all paths in a directory tree that match the REGEX input" (interactive) (ivy-read "Find: " #'counsel-find-function :initial-input initial-input :dynamic-collection t :history 'counsel-find-history :action (lambda (file) (with-ivy-window (when file (find-file file)))) :unwind #'counsel-delete-process :caller 'counsel-find)) (counsel-set-async-exit-code 'counsel-find 1 "Nothing found")
counsel equivalent of
counsel-dired-jump and John Kitchin's answer for suggestions on writing a custom function.