Skip to content
Discussion options

You must be logged in to vote

The above only fills in the directory part.
The original find-file with ffap fills in the filename also. This is really convenient because C-x C-f RET on a file path will get me right to the file.

I've copied bulk of code from read-file-name-default to accomplish this.
It would better if there's simpler way to achieve this though.

  ;; Previewing files in find-file. https://github.com/minad/consult/wiki#previewing-files-in-find-file
  ;; Code partially copied from read-file-name-default
  (defun consult-find-file-with-preview (prompt &optional dir default-filename mustmatch initial pred)
    (interactive)
    (unless dir (setq dir (or default-directory "~/")))
    (unless (file-name-absol…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@jeffy1009
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by jeffy1009
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