From c096cd184998119a15ce3794aa50a174e30b7e05 Mon Sep 17 00:00:00 2001 From: bhagwan Date: Sun, 16 Jan 2022 15:41:31 -0800 Subject: [PATCH] grep_project: exclude filename from fuzzy search by default --- lua/fzf-lua/providers/grep.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lua/fzf-lua/providers/grep.lua b/lua/fzf-lua/providers/grep.lua index d8cc91f..fab9151 100644 --- a/lua/fzf-lua/providers/grep.lua +++ b/lua/fzf-lua/providers/grep.lua @@ -362,6 +362,11 @@ end M.grep_project = function(opts) if not opts then opts = {} end if not opts.search then opts.search = '' end + -- by default, do not include filename in search + if not opts.fzf_opts or opts.fzf_opts["--nth"] == nil then + opts.fzf_opts = opts.fzf_opts or {} + opts.fzf_opts["--nth"] = '2..' + end return M.grep(opts) end