Skip to content

gpncarl/jumph.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

jumph

A high-performance Neovim jump label plugin based on FFI that adds numeric labels to search results for quick navigation.

Features

  • Built with LuaJIT FFI for exceptional performance
  • Adds numeric labels to matches of the current search pattern

Installation

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:

Usage

  1. Use / or ? to search
  2. Press <CR> to trigger jumph.count_label
  3. Numeric labels appear on search results
  4. 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

About

A high-performance Neovim jump label plugin based on FFI that adds numeric labels to search results for quick navigation.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages