feat(flash): add search-style flash jump with regex pattern
This commit is contained in:
1 parent
c86fca60d6
commit
0410c40ac1
1 file changed
+19
-3
+19
-3
@@ -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" },
|
||||
|
||||
Reference in new issue
Block a user