feat(flash): add search-style flash jump with regex pattern

This commit is contained in:
Prad Nukala committed 2026-07-12 11:01:47 -04:00
1 parent c86fca60d6
commit 0410c40ac1
1 file changed
+19 -3
+19 -3
View File
@@ -7,9 +7,10 @@ return {
opts = { opts = {
modes = { modes = {
char = { char = {
-- normal-mode `f` is the Vimium-style word jump below, so flash's -- normal-mode `f` is the Vimium-style word jump and `F` is the
-- char mode must not rebind it; F/t/T/;/, stay enhanced -- search-style jump below, so flash's char mode must not rebind
keys = { "F", "t", "T", ";", "," }, -- them; t/T/;/, stay enhanced
keys = { "t", "T", ";", "," },
}, },
}, },
}, },
@@ -28,6 +29,21 @@ return {
end, end,
desc = "Jump to word (Vimium-style)", desc = "Jump to word (Vimium-style)",
}, },
{
"F",
mode = "n",
function()
-- Search-style flash: type a regex pattern (incremental, like
-- incsearch) and labels appear on every match. The pattern is
-- pushed to search history and the `/` register, so `n`/`N`
-- keep working after the jump.
require("flash").jump {
search = { mode = "search", incremental = true },
jump = { history = true, register = true, nohlsearch = true },
}
end,
desc = "Flash search",
},
{ "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" }, { "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" },
{ "S", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" }, { "S", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" },
{ "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" }, { "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" },