live_grep_glob feature request
I added the below check for some ripgrep search flags to glob_parse and pass those through.
This allows me to do a live_grep_glob and add -w, -i, etc, etc on the fly to ripgrep, which is pretty useful. (I'm currently using vim-agriculture for this, but I like FzfLua better. :)
There might be a better way to do this, but for quick and dirty the below is working pretty well for me right now.
No pressure taking this or not, of course. Thanks!
M.glob_parse = function(opts, query)
if not query or not query:find(opts.glob_separator) then
return query, nil
end
local glob_args = ""
local search_query, glob_str = query:match("(.*)"..opts.glob_separator.."(.*)")
for _, s in ipairs(utils.strsplit(glob_str, "%s")) do
if string.match(s, '^-%a$') then
glob_args = glob_args .. s .. ' '
else
glob_args = glob_args .. ("%s %s ")
:format(opts.glob_flag, vim.fn.shellescape(s))
end
end
return search_query, glob_args
end