Closed maximbaz closed 5 years ago
This is a good idea, I think adding a couple of options settable with zstyle
will be the way to go, e.g.:
zstyle :fzy:file command <string>
zstyle :fzy:cd command <string>
where <string>
can be any command that produces a list of elements on standard output, one per line. In particular I think it is important to allow using shell functions, to allow any complex behavior. Silly example:
function list-files-for-fzy {
rg --files | rg -vF '/old/'
}
zstyle :fzy:file command list-files-for-fzy
On top of allowing for more customization, this would also allow to wrap the commands currently being used inside functions to easily reuse them as defaults.
This is powerful, just to confirm, would it always be necessary to define a function, or something like this would work too?
zstyle :fzy:file command 'rg --files'
@maximbaz Defining a function will be optional. Your configuration using the command string directly should work as well.
@maximbaz The needed changes are now in master
, please update, and let me know if you find any problem with the new feature. Note that the zstyle
settings for command
are arrays, and you will need to use the following:
zstyle :fzy:file command rg --files # No quoting needed.
Works very well, thanks a lot!
I'd like to replace
find
command used infzy-file-widget
with something else, for examplerg --files
. Same would apply forfzy-cd-widget
.This would allow me to ignore certain files and folders, for example I never want to look for files inside
.git
directory.