Skip to content

Thomas485/comment-navigator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

comment-navigator

A simple nvim plugin to jump between (special) comments.

Preview

commentnavigator

Setup

This is my current setup:

local comment_navigator = require('comment_navigator')

local comment_filetypes = {
    {"*.{odin,c,cc,cpp,cxx}", comment_navigator.regex.c},
    {"*.lua", comment_navigator.regex.lua},
    {"*.py", comment_navigator.regex.python}
}

for _, cf in ipairs(comment_filetypes) do
    local cn = comment_navigator.setup({
        regex = cf[2]
    })
    vim.api.nvim_create_autocmd("BufEnter", {
        pattern = cf[1],
        callback = function()
            vim.keymap.set('n', '<space>c', cn.open, { noremap = true, silent = true })
        end
    })
end

Configuration

You can find all options here

predefined comment styles

You can find a list here

custom comments

Just use your own (lua)regex.

The first capture is the indentation, the second the text to show.

About

A simple nvim plugin to jump between comments.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages