Remove custom consult-fd to use new builtin one
This commit is contained in:
parent
cd06f1a12f
commit
7c066c42b0
|
@ -284,29 +284,6 @@ DEFS is a plist associating completion categories to commands."
|
|||
(defun consult-ripgrep-parent (&optional initial)
|
||||
(interactive "P")
|
||||
(consult-ripgrep (file-name-directory (directory-file-name (persp-current-project-root))) initial))
|
||||
(defvar consult--fd-command nil)
|
||||
(defun consult--fd-builder (input)
|
||||
(unless consult--fd-command
|
||||
(setq consult--fd-command
|
||||
(if (eq 0 (call-process-shell-command "fdfind"))
|
||||
"fdfind"
|
||||
"fd")))
|
||||
(pcase-let* ((`(,arg . ,opts) (consult--command-split input))
|
||||
(`(,re . ,hl) (funcall consult--regexp-compiler
|
||||
arg 'extended t)))
|
||||
(when re
|
||||
(list :command (append
|
||||
(list consult--fd-command
|
||||
"--color=never" "--full-path"
|
||||
(consult--join-regexps re 'extended))
|
||||
opts)
|
||||
:highlight hl))))
|
||||
|
||||
(defun consult-fd (&optional dir initial)
|
||||
(interactive "P")
|
||||
(let* ((prompt-dir (consult--directory-prompt "Fd" dir))
|
||||
(default-directory (cdr prompt-dir)))
|
||||
(find-file (consult--find (car prompt-dir) #'consult--fd-builder initial))))
|
||||
|
||||
(defalias 'consult-line-thing-at-point 'consult-line)
|
||||
(defalias 'consult-ripgrep-thing-at-point 'consult-ripgrep)
|
||||
|
|
Loading…
Reference in New Issue