FzfLua: Add shortcut for finding snippets

This commit is contained in:
a.shalimov 2026-10-05 14:48:10 +03:00
parent 589cab3c11
commit c54b4be291

View file

@ -190,3 +190,13 @@ keymap("n", "<leader>fdp", function()
no_esc = true, no_esc = true,
}) })
end, { desc = "FZF: unresolved problems in current buffer" }) 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", "<leader>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" })