Is it possible to use the semicolon to repeat (continue actually) a jump?
My config looks like below, so I primarily use flash by hitting s or S, typing some chars and then select the label of the thing I'm aiming for (my target).
Now more then often I find myself updating or changing something at the target location and then realize I want to repeat that action in a similar part of my code so my muscle memory makes me hit ; to repeat the action and somehow I expect it to repeat hitting s again and typing in the same chars to get the labels again allowing me to choose the next target.
Would something like that be possible somehow? I thought maybe the continue option was for that, but that doesn't seem the case.
Thanks!
return {
'folke/flash.nvim',
event = "VeryLazy",
keys = {
{
's',
mode = { 'n', 'x', 'o' },
function()
require('flash').jump({
search = { forward = true, wrap = false, multi_window = false },
})
end,
},
{
'S',
mode = { 'n', 'x', 'o' },
function()
require('flash').jump({
search = { forward = false, wrap = false, multi_window = false },
})
end,
},
},
config = function()
require('flash').setup {
continue = true,
modes = {
char = {
enabled = false,
},
search = {
enabled = false,
}
}
}
end,
}
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This is still something that I would love to be able to do... Is there any way to do/configure this?
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This is still something that I would love to be able to do... Is there any way to do/configure this?
I'm also very interested in this feature. I simply want to continue my jump after performing some action, like replacing text.
That is exactly my usecase/flow as well...
@folke I'm willing to put in some time and effort to (help) add something for this if you are open to it and think it can be done? But if so, it would be great if you could maybe get me started with a high level idea on how or where (in code) to add this.
Thanks!
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
Would still like this 😊
I would also like to see this implemented. I think there should be a key to move between jump matches, similar to a few other plugins in this style.
I will note however if you enable:
history = true,
as a param to jump, the jump search will get added to search history, so you can at that point hit n to go to the next match.
at least that is how its supposed to work I think but I've had some trouble with getting this to work consistently...
OK played with this just a little today and found out it can already be done 🙈
Given this config:
return {
'folke/flash.nvim',
event = "VeryLazy",
keys = {
{
's',
mode = { 'n', 'x' },
function()
require('flash').jump({
continue = true, -- this is the line I added
search = { forward = true, wrap = false, multi_window = false },
})
end,
},
{
'S',
mode = { 'n', 'x' },
function()
require('flash').jump({
continue = true, -- this is the line I added
search = { forward = false, wrap = false, multi_window = false },
})
end,
},
},
config = function()
-- Configure flash.nvim
require('flash').setup {
label = {
uppercase = false,
},
modes = {
char = {
enabled = false,
},
prompt = {
enabled = false,
},
search = {
enabled = false,
}
}
}
end,
}
When I press s or S again it continues the search where it left off. Wonder how I missed that before, but adding the continue = true lines fixed this issue.
OK played with this just a little today and found out it can already be done 🙈
Given this config:
return { 'folke/flash.nvim', event = "VeryLazy", keys = { { 's', mode = { 'n', 'x' }, function() require('flash').jump({ continue = true, -- this is the line I added search = { forward = true, wrap = false, multi_window = false }, }) end, }, { 'S', mode = { 'n', 'x' }, function() require('flash').jump({ continue = true, -- this is the line I added search = { forward = false, wrap = false, multi_window = false }, }) end, }, }, config = function() -- Configure flash.nvim require('flash').setup { label = { uppercase = false, }, modes = { char = { enabled = false, }, prompt = { enabled = false, }, search = { enabled = false, } } } end, }When I press
sorSagain it continues the search where it left off. Wonder how I missed that before, but adding thecontinue = truelines fixed this issue.
I think this works until you want to start a new jump. Did you end up finding a workaround for resetting the jump search term?
Yes I realized that quite quickly as well 😏 As I almost never search backwards I decided to make s search forward and S repeat the forward search. So it's still (by far) not perfect but it somehow works for me. If you come across a better solution I'm all ears 😉