From 7d961578171b8cbdc47c3f481acf4017ba67b289 Mon Sep 17 00:00:00 2001 From: Emmanuel Pilande Date: Fri, 5 Jul 2024 15:50:12 -0700 Subject: [PATCH] feat(fzf): Add ability to send additional flags to ripgrep --- lua/lazyvim/plugins/extras/editor/fzf.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lua/lazyvim/plugins/extras/editor/fzf.lua b/lua/lazyvim/plugins/extras/editor/fzf.lua index 67acc830..8c40e5f3 100644 --- a/lua/lazyvim/plugins/extras/editor/fzf.lua +++ b/lua/lazyvim/plugins/extras/editor/fzf.lua @@ -167,6 +167,15 @@ return { }, }, grep = { + rg_glob = true, + -- first returned string is the new search query + -- second returned string are (optional) additional rg flags + -- @return string, string? + rg_glob_fn = function(query) + local regex, flags = query:match("^(.-)%s%-%-(.*)$") + -- If no separator is detected will return the original query + return (regex or query), flags + end, actions = { ["alt-i"] = { actions.toggle_ignore }, ["alt-h"] = { actions.toggle_hidden },