nvim: Add mapping to flash.nvim current word

Use <S> to jump to any word that is the same as the current word under
the cursor using flash.

Moved the previous flash treesitter binding and updated it to
`treesitter_search` so any word in the current buffer view can be used
as starting point for a tresitter-based selection. Mapping moved to <R>
as is (somewhat) mimics the <yr...> remote-based mappings for flash.
This commit is contained in:
Marty Oehme 2025-12-11 20:24:38 +01:00
parent ab3a104a85
commit 585a48ff94
Signed by: Marty
GPG key ID: 4E535BC19C61886E

View file

@ -24,11 +24,13 @@ return {
},
{
"S",
mode = { "n", "x", "o" },
mode = { "n", "x" },
function()
require("flash").treesitter()
require("flash").jump({
pattern = vim.fn.expand("<cword>"),
})
end,
desc = "Flash Treesitter",
desc = "Flash",
},
{
"r",
@ -38,6 +40,14 @@ return {
end,
desc = "Remote Flash",
},
{
"R",
mode = { "n", "x", "o" },
function()
require("flash").treesitter_search()
end,
desc = "Flash Treesitter",
},
},
},
-- extend the ^x / ^a possibilities to dates, hex, alphabets, markdown headers