andreyorst / fzf.kak

FZF for Kakoune
MIT License
143 stars 33 forks source link

Simplify approach to providing an alternative fzf file find invocation #104

Open sidkshatriya opened 2 years ago

sidkshatriya commented 2 years ago

Here is the sample kakrc configuration now using the simplified approach.

hook global ModuleLoaded fzf-file %{
    set global fzf_file_command "rg -L --files"
    set global fzf_file_alternative_command "rg -L --files --no-ignore"
}

P.S. As this commit reverts some changes of the previous commit cb07538a88dd51b1c03800d6c451d2d71e7b80a5 , it is also useful to see the following.

https://github.com/andreyorst/fzf.kak/compare/95b12b1fe93c6db0441c61062823231a28eed037..a1012402af3db8411144877437697fb678424a24

The above link compares this PR with the commit

commit 95b12b1fe93c6db0441c61062823231a28eed037
Author: Andrey Listopadov <andreyorst@gmail.com>
Date:   Wed Mar 23 19:55:27 2022 +0300

    fzf-grep file preview

The above diff is probably simpler to review.

andreyorst commented 2 years ago

hm, so instead of passing additional arguments to fzf-file this PR makes a separate command for that purpose? I think your previous method is more simple in a sense that it's just additional arguments, taht allow you to define your own versions of fzf-file and binding them to convenient keys, like "only search hidden files" or "only search current buffer's extension files". This one seems less flexible in this regard.

sidkshatriya commented 2 years ago

Here is my reasoning why this is a better approach:

In general this approach allows an arbitrary alternative command and it's simpler for the end user...

andreyorst commented 2 years ago

Maybe we could have both ways, as they aren't mutually exclusive?