flash.nvim
flash.nvim copied to clipboard
feature: there's no easy way to jump to the last character of the line?
Did you check the docs?
- [X] I have read all the flash.nvim docs
Is your feature request related to a problem? Please describe.
I can't jump to the last character of the line. May I missed something in doc, but I read it twice.
Describe the solution you'd like
I used leap.nvim and just type <Space> at EOL.
Describe alternatives you've considered
To go back to leap.nvim, idk. :D But flash is awesome!
Additional context
{
'folke/flash.nvim',
---@type Flash.Config
opts = {
label = { uppercase = false },
prompt = { enabled = false },
modes = {
search = { enabled = false },
treesitter = { label = { rainbow = { enabled = true, shade = 2 } } },
treesitter_search = { label = { rainbow = { enabled = true, shade = 2 } } },
},
},
-- stylua: ignore
keys = {
'f', 'F', 't', 'T',
{ 'gs', function() require('flash').jump() end, mode = { 'n', 'x', 'o' } },
{ 'gz', function() require('flash').treesitter() end, mode = { 'n', 'x', 'o' } },
{ 'gZ', function() require('flash').treesitter_search() end, mode = { 'o', 'x' } },
{ 'r', function() require('flash').remote() end, mode = 'o' },
{
'ygw',
function()
require('flash').jump {
action = function(match, state)
vim.api.nvim_set_current_win(match.win)
vim.api.nvim_win_set_cursor(match.win, match.pos)
vim.cmd.norm { args = { 'yiw' }, bang = true }
state:restore()
end,
}
end,
},
},
}
Is this different than the general vim motion g_
?
Is this different than the general vim motion
g_
?
Of course, because the jump works across all windows and rows
I can't jump to the last character of the line.
but then you do not want to jump to the last character of the line, you want to mark/jump the last character-s of each line, is it correct?
but then you do not want to jump to the last character of the line, you want to mark/jump the last character-s of each line, is it correct?
What? I just want to jump to any character on the screen, including the last characters of the lines.
BTW, for the moment I found a workaround - use search mode. But there seems to be a bug with backslashes. You just can't use backslashes in search mode unless there is no backslash on the screen, in which case the search will instantly abort.
p.s. I haven't looked for issues that describe that, perhaps it already exists
Additionally, it would be nice if we could also jump to blank lines.
With leap, you can just do this by pressing s<space><space>
(assuming your "leap bind" is s
). Then it would show labels for every blank line (even if it doesn't actually have two spaces) and you can jump directly to them
with flash this is not currently possible, I believe
@name-snrl
function()
require("flash").jump({
search = { mode = "search", max_length = 0 },
label = { after = { 0, 0 } },
pattern = "^", -- replace with $ for end of line
})
end
This function is provided in the "Examples" section which can be used to go to the beginning of a line, but not at the end.
I think we should find a regex to put in the pattern
section which matches ^ AND $ that is, the beginning AND end of line.
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 issue was closed because it has been stalled for 7 days with no activity.