Replies: 3 comments 1 reply
-
I think you are looking for the words snack - here's some example {
{
"]]",
function()
Snacks.words.jump(vim.v.count1)
end,
desc = "Next Reference",
},
{
"[[",
function()
Snacks.words.jump(-vim.v.count1)
end,
desc = "Prev Reference",
},
} |
Beta Was this translation helpful? Give feedback.
-
I'm taking about going through symbols in the buffer (not the symbol my cursor is at). I can list all symbols using Snacks picker. But I'm looking for something like
Hit some keymap or a function to navigate to next symbol (within the buffer).
This example is given just for functions, but it would be great to go through all symbols not just for a particular symbols. Similar to |
Beta Was this translation helpful? Give feedback.
-
I think that has more to do with treesitter. I have my treesitter config like this: textobjects = {
select = {
enable = true,
lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim
keymaps = {
-- You can use the capture groups defined in textobjects.scm
["aa"] = "@parameter.outer",
["ia"] = "@parameter.inner",
["af"] = "@function.outer",
["if"] = "@function.inner",
["ac"] = "@class.outer",
["ic"] = "@class.inner",
},
},
move = {
enable = true,
set_jumps = true, -- whether to set jumps in the jumplist
goto_next_start = {
["]f"] = "@function.outer",
-- ["]c"] = "@class.outer",
["]a"] = "@parameter.inner",
},
goto_next_end = {
["]F"] = "@function.outer",
-- ["]C"] = "@class.outer",
["]A"] = "@parameter.inner",
},
goto_previous_start = {
["[f"] = "@function.outer",
-- ["[c"] = "@class.outer",
["[a"] = "@parameter.inner",
},
goto_previous_end = {
["[F"] = "@function.outer",
-- ["[C"] = "@class.outer",
["[A"] = "@parameter.inner",
},
},
},
Then you can move across function with '[f' and other listed keybinds |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Right now there's a picker to show all LSP symbols. As the title says, is it possible to jump to next/previous immediate symbol given the current cursor position. Just like
AerialNext
andAerialPrev
Beta Was this translation helpful? Give feedback.
All reactions