Visitar URL original
How to pass this fd command to consult? · minad/consult · Discussion #1338 · GitHub
Skip to content
Discussion options

You must be logged in to vote

consult-fd is designed for interactive searching, where what you type becomes the fd pattern. For a fixed command like yours, it's simpler to run fd once and hand the results to completing-read. Consult/Vertico (or whatever completion UI you use) gives you fuzzy selection automatically.

Put this in your config:

(defun my/config-files ()
  "Return a list of my important Emacs config files."
  (mapcar #'abbreviate-file-name
          (process-lines "fd" "-d" "1" "\\.el$"
                         (expand-file-name "~/.config/emacs")
                         (expand-file-name "~/.config/emacs/elisp"))))

(defun my/open-config-file ()
  "Fuzzy-pick one of my config files and open it."
  (inter…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by rieje
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants