A high-performance Neovim jump label plugin based on FFI that adds numeric labels to search results for quick navigation.
- Built with LuaJIT FFI for exceptional performance
- Adds numeric labels to matches of the current search pattern
Using lazy.nvim:
{
"gpncarl/jumph.nvim",
keys = {
{
"<cr>",
function()
require("jumph").count_label(vim.fn.getreg("/"))
end,
mode = { "n", "x" },
desc = "Jumph: add count lable to last search",
},
},
init = function()
local jumph_group = vim.api.nvim_create_augroup("jumph", { clear = true })
vim.api.nvim_create_autocmd("FileType", {
pattern = "qf",
group = jumph_group,
callback = function()
vim.keymap.set('', '<cr>', '<cr>', { buffer = true })
end,
desc = "Revert <cr>"
})
vim.api.nvim_create_autocmd("CmdwinEnter", {
pattern = "*",
group = jumph_group,
callback = function()
vim.keymap.set('', '<cr>', '<cr>', { buffer = true })
end,
desc = "Revert <cr>"
})
end,
opts = {},
}If you map
<CR>as the trigger key, it's recommended to add autocmds to avoid interference in specific scenarios:
- Use
/or?to search - Press
<CR>to triggerjumph.count_label - Numeric labels appear on search results
- Type a number followed by a motion (e.g.,
3n,5N) to jump to that position
Example:
" Search for 'function'
/function<CR>
" Add numeric labels
<CR>
" Jump to the 3rd match
3n