the code
This commit is contained in:
@@ -1,2 +1,32 @@
|
||||
# comment-navigator
|
||||
A simple nvim plugin to jump between comments.
|
||||
|
||||
A simple nvim plugin to jump between (special) comments.
|
||||
|
||||
## Preview
|
||||
|
||||

|
||||
|
||||
## Setup
|
||||
This is my current setup:
|
||||
```lua
|
||||
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
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user