feat(snacks.picker): flash.nvim integration

This commit is contained in:
Folke Lemaitre 2025-01-29 20:18:43 +01:00
parent f0d2629bd8
commit 5d24aa6311
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -153,4 +153,45 @@ return {
{ "<leader>sT", function () Snacks.picker.todo_comments({ keywords = { "TODO", "FIX", "FIXME" } }) end, desc = "Todo/Fix/Fixme" },
},
},
{
"folke/snacks.nvim",
optional = true,
specs = {
{
"folke/snacks.nvim",
opts = {
picker = {
win = {
input = {
keys = {
["<a-s>"] = { "flash", mode = { "n", "i" } },
["s"] = { "flash" },
},
},
},
actions = {
flash = function(picker)
require("flash").jump({
pattern = "^",
label = { after = { 0, 0 } },
search = {
mode = "search",
exclude = {
function(win)
return vim.bo[vim.api.nvim_win_get_buf(win)].filetype ~= "snacks_picker_list"
end,
},
},
action = function(match)
local idx = picker.list:row2idx(match.pos[1])
picker.list:move(idx, true)
end,
})
end,
},
},
},
},
},
},
}