Add toggle-bind
action bind (allow reuse of the same keybind for unbind|rebind
)
#2865
Closed
3 tasks done
man fzf
)Info
First, ty @junegunn for this magical piece of software!
Related #2564, #2843.
Following the very useful example Switching between Ripgrep mode and fzf mode, a use can press
ctrl-f
to unbind thechange
event, enable search and fuzzy match followed by actrl-r
to rebind thechange
event and disable search.The above IMHO can be more efficient if there was a
toggle-bind
action, in the above example, there's no real point of pressingctrl-r
orctrl-f
more than once, you only press it when you wish to toggle from disabled search to fuzzy search and vice versa, with atoggle-bind
action we could have one keybind (sayctrl-r
) to switch back and forth between the different modes.This could be futher improved with:
change-header
action with support for the current query so that when the user switches mode the header can display the query from the previous modeAn exmaple for the above would be:
rg
and search forfoo.*
results for regex: foo.*
(so now we know what we're doing fuzzy searching on)foo.*
as the fuzzy query doesn't make much sense in this contextbar.*
and toggle back to fuzzy, the header will now display results for regex: bar.*` and also restore the previous query that was typed in fuzzy mode*I have a working exmaple of the above in my neovim plugin
fzf-lua
by using a single bindctrl-g
, I created this before therebind
action was introduced by restarting the fzf process with different options that were saved externally, you can watch this exact same behavior in action below to see how useful it is:The text was updated successfully, but these errors were encountered: