-
I am using a lot of live_grep with a lot of exclusions like this I want to be able to have sets of those exclusions and switch between them while using live_grep Ideally I'd have a keymap that pops open the picker with prefilled exclusions and puts the cursor right between I tried passing search opt to live_grep, but it puts the cursor at the end. Can anybody hint at a right direction here? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 28 replies
-
There are many ways to go about this problem, one way I can think of is crafting your own
You can send Another option is to open :lua require'fzf-lua'.grep({ no_esc=true, rg_glob=true, search=' -- *.lua' }) |
Beta Was this translation helpful? Give feedback.
-
Found your ideal solution using fzf's :lua require'fzf-lua'.live_grep({
no_esc=true,
rg_glob=true, search=[[\b\b -- *.lua]],
keymap = { fzf = { start = "beginning-of-line+forward-char+forward-char" }}
}) We can also use the "dotted" format for a slightly shorter command: :lua require'fzf-lua'.live_grep({
no_esc=true,
rg_glob=true, search=[[\b\b -- *.lua]],
["keymap.fzf.start"] = "beginning-of-line+forward-char+forward-char"
}) For more options to send to fzf, |
Beta Was this translation helpful? Give feedback.
-
Hi @ibhagwan, I have a similar question and didn't wanna open a new discussion. I would like to open I got this far: require("fzf-lua").live_grep({
cwd = <path>,
rg_glob = true,
no_esc = true,
search = " -- *.lua",
keymap = { fzf = { start = "beginning-of-line" } },
}) Which works great, but I'd like for the pattern to not show in the search, is this possible? I feel that this is answered already but I'm not understanding it. EDIT: Is this what I want? require("fzf-lua").live_grep({
rg_opts = "-g '*.lua' -e",
}) If yes, can I access/use the default I think I got it, it works, but is it the right way? EDIT: local rg_opts = require("fzf-lua").defaults.grep.rg_opts
require("fzf-lua").live_grep({
rg_opts = "-g *.lua " .. rg_opts,
}) |
Beta Was this translation helpful? Give feedback.
Found your ideal solution using fzf's
start
event:We can also use the "dotted" format for a slightly shorter command:
For more options to send to fzf,
man fzf
and search forAVAILABLE ACTIONS
:https://github.com/junegunn/fzf/blob/4e9e842aa4…