From c54b4be2910860eb59843a65403fc1462e89c09a Mon Sep 17 00:00:00 2001 From: "a.shalimov" Date: Mon, 5 Oct 2026 14:48:10 +0300 Subject: [PATCH] FzfLua: Add shortcut for finding snippets --- lua/custom/fzf_lua.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lua/custom/fzf_lua.lua b/lua/custom/fzf_lua.lua index acd47c1..73c8166 100644 --- a/lua/custom/fzf_lua.lua +++ b/lua/custom/fzf_lua.lua @@ -190,3 +190,13 @@ keymap("n", "fdp", function() no_esc = true, }) end, { desc = "FZF: unresolved problems in current buffer" }) + +-- Exact search of text placed right after a ``` fence (code snippet first line) in cwd +keymap("n", "fcs", function() + fzf_lua.live_grep({ + prompt = 'Code snippetsāÆ ', + search = '(?<=```\\n)', + no_esc = true, + rg_opts = "--column --line-number --no-heading --color=always --smart-case -U --pcre2 -g '*.md'", + }) +end, { desc = "FZF: search first line of code blocks in cwd" })