From bca2107b63fdbfa5d98f1636fbbf12d343f9c87d Mon Sep 17 00:00:00 2001 From: bhagwan Date: Fri, 11 Mar 2022 18:18:07 -0800 Subject: [PATCH] disable 'ctrl-g' for l|grep_curbuf, hide filename in 'blines' --- lua/fzf-lua/config.lua | 4 ++-- lua/fzf-lua/providers/grep.lua | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lua/fzf-lua/config.lua b/lua/fzf-lua/config.lua index 012736e..e563492 100644 --- a/lua/fzf-lua/config.lua +++ b/lua/fzf-lua/config.lua @@ -371,7 +371,7 @@ M.globals.blines = { show_unlisted = true, no_term_buffers = false, fzf_opts = { - ['--delimiter'] = "'[\\]:]'", + ['--delimiter'] = "'[:]'", ["--with-nth"] = '2..', ["--tiebreak"] = 'index', }, @@ -401,7 +401,7 @@ M.globals.btags = { git_icons = true, color_icons = true, fzf_opts = { - ['--delimiter'] = "'[\\]:]'", + ['--delimiter'] = "'[:]'", ["--with-nth"] = '2..', ["--tiebreak"] = 'index', }, diff --git a/lua/fzf-lua/providers/grep.lua b/lua/fzf-lua/providers/grep.lua index 6df2aa3..f433952 100644 --- a/lua/fzf-lua/providers/grep.lua +++ b/lua/fzf-lua/providers/grep.lua @@ -469,6 +469,11 @@ M.grep_curbuf = function(opts) opts.fzf_opts = vim.tbl_extend("keep", opts.fzf_opts or {}, config.globals.blines.fzf_opts) opts.filename = vim.api.nvim_buf_get_name(0) + -- disable ctrl-g switch by default + if not opts.actions or not opts.actions["ctrl-g"] then + opts.actions = opts.actions or {} + opts.actions["ctrl-g"] = false + end if #opts.filename > 0 and vim.loop.fs_stat(opts.filename) then opts.filename = path.relative(opts.filename, vim.loop.cwd()) if opts.lgrep then