Open vspinu opened 1 year ago
BTW, if I invoke find-file
from inside the consult-buffer
I do get the file opened but the consult-buffer interface stays open, which is not ideal either.
If you use Embark, the cleanest way to do this is to add consult-dir
to embark-file+buffer-map
and switch to consult-dir
from consult-buffer
using embark-become
.
Besides the Embark approach I'm not sure of how to do this. consult-buffer
and consult-dir
are fundamentally different, incommensurate commands.
This is a small quick hack that works for me:
(defvar rh-consult-dir--source-recentf
`(:name "Directory"
:narrow ?d
:category file
:face consult-file
:history file-name-history
:action ,#'dired
:state ,#'consult--file-preview
:enabled ,(lambda () recentf-mode)
:items ,#'consult-dir--recentf-dirs)
"Recentf directory source for `consult-buffer-sources'.")
(add-to-list 'consult-buffer-sources 'rh-consult-dir--source-recentf t)
This is what I would like to achieve:
consult-buffer
invokeconsult-dir
consult-buffer
.So basically I want
consult-dir
not to return to the original completion system but perform its normal action.Maybe this can be achieved by default. It doesn't make much sense to insert the full path into
consult-buffer
interface. WDYT?