fzf-lua
fzf-lua copied to clipboard
Question: built-in `toggle_ignore` action to `grep`/`live_grep`
First of all, thank you for the amazing plugin ❤️
I was trying to build my own grep
/live_grep
version of the toggle_ignore
action, but after digging into the code I saw it would not be that trivial since the resume action for these commands is very different from the files
picker. I've tried adding the toggle_ignore_flag
, changing the rg_opts
and then resume
, but I couldn't get it right.
Are there any plans on adding a built-in toggle_ignore
action to these commands?
Thank you!
First of all, thank you for the amazing plugin ❤️
Ty for your kind words.
Are there any plans on adding a built-in toggle_ignore action to these commands?
I'm not sure about adding that, the UI is already loaded with info, perhaps we can make the curren't command work for grep/live_grep too and it can be an optional addition users can add to their actions (as was before I made this the default with files)?
@estacioneto, use:
local fzf_lua = require("fzf-lua")
fzf_lua.setup({
grep = {
-- use `ctrl-r` to not override the `ctrl-g` regex toggle
actions = { ["ctrl-r"] = { fzf_lua.actions.toggle_ignore } },
}
})
For example :FzfLua grep search=testing debug=true
:
After pressing ctrl-r
:
Note the
rg
command added--no-ignore
as its first flag as wel as the match in thedoc\tags
file which is in fzf-lua's.gitignore
After pressing ctrl-g
to switch to live grep, the flag is still respected:
@ibhagwan amazing!
perhaps we can make the curren't command work for grep/live_grep too
That was exactly what I wanted, especially because it will work with the actions descriptions out of the box.
Thank you so much for doing it so fast! 🤩
@ibhagwan amazing!
perhaps we can make the curren't command work for grep/live_grep too
That was exactly what I wanted, especially because it will work with the actions descriptions out of the box.
Thank you so much for doing it so fast! 🤩
Ty @estacioneto, there's just one tiny issue (if you look at my screenshots), the switch to regex header is not displayed properly when toggling gitignore on grep, will be fixed soon too.
@estacioneto, should work as expected on latest.