From 0410c40ac1139e23979e8a235a5677ea52acadb7 Mon Sep 17 00:00:00 2001 From: Prad Nukala Date: Sun, 12 Jul 2026 11:01:47 -0400 Subject: [PATCH] feat(flash): add search-style flash jump with regex pattern --- lua/plugins/flash.lua | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/lua/plugins/flash.lua b/lua/plugins/flash.lua index 82eb91f..85e7466 100644 --- a/lua/plugins/flash.lua +++ b/lua/plugins/flash.lua @@ -7,9 +7,10 @@ return { opts = { modes = { char = { - -- normal-mode `f` is the Vimium-style word jump below, so flash's - -- char mode must not rebind it; F/t/T/;/, stay enhanced - keys = { "F", "t", "T", ";", "," }, + -- normal-mode `f` is the Vimium-style word jump and `F` is the + -- search-style jump below, so flash's char mode must not rebind + -- them; t/T/;/, stay enhanced + keys = { "t", "T", ";", "," }, }, }, }, @@ -28,6 +29,21 @@ return { end, 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").treesitter() end, desc = "Flash Treesitter" }, { "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" },