Turned off find file with consult

This commit is contained in:
Aleksandr Lebedev 2025-07-14 08:02:05 +02:00
parent 4d13ce9abb
commit f71c36a25d

View file

@ -1830,13 +1830,13 @@ one, an error is signaled."
;; You may want to use `embark-prefix-help-command' or which-key instead. ;; You may want to use `embark-prefix-help-command' or which-key instead.
;; (keymap-set consult-narrow-map (concat consult-narrow-key " ?") #'consult-narrow-help) ;; (keymap-set consult-narrow-map (concat consult-narrow-key " ?") #'consult-narrow-help)
) )
(require 'consult) (require 'consult)
(setq read-file-name-function #'consult-find-file-with-preview) ;;(setq read-file-name-function #'consult-find-file-with-preview)
;;Previewing files in find-file ;;Previewing files in find-file
(defun consult-find-file-with-preview (prompt &optional dir default mustmatch initial pred) (defun consult-find-file-with-preview (prompt &optional dir default mustmatch initial pred)
(interactive) (interactive)
(let ((default-directory (or dir default-directory)) (let ((default-directory (expand-file-name (or dir default-directory)))
(minibuffer-completing-file-name t)) (minibuffer-completing-file-name t))
(consult--read #'read-file-name-internal :state (consult--file-preview) (consult--read #'read-file-name-internal :state (consult--file-preview)
:prompt prompt :prompt prompt
@ -1844,10 +1844,10 @@ one, an error is signaled."
:require-match mustmatch :require-match mustmatch
:predicate pred))) :predicate pred)))
;;Previewing files for project-find-file ;;Previewing files for project-find-file
(setq project-read-file-name-function #'consult-project-find-file-with-preview) (setq project-read-file-name-function #'consult-project-find-file-with-preview)
(defun consult-project-find-file-with-preview (prompt all-files &optional pred hist _mb) (defun consult-project-find-file-with-preview (prompt all-files &optional pred hist _mb)
(let ((prompt (if (and all-files (let ((prompt (if (and all-files
(file-name-absolute-p (car all-files))) (file-name-absolute-p (car all-files)))
prompt prompt