✨ feat: add todo-comments plugin for enhanced code annotation
This commit is contained in:
3 files changed
+80
-4
No files matched your search
+75
-4
@@ -249,10 +249,19 @@ local plugins = {
|
||||
},
|
||||
{
|
||||
'windwp/nvim-ts-autotag',
|
||||
event = { 'BufReadPre', 'BufNewFile' },
|
||||
config = function()
|
||||
require('nvim-ts-autotag').setup()
|
||||
end,
|
||||
ft = {
|
||||
'html',
|
||||
'javascriptreact',
|
||||
'typescriptreact',
|
||||
'svelte',
|
||||
'vue',
|
||||
'tsx',
|
||||
'jsx',
|
||||
'markdown',
|
||||
'handlebars',
|
||||
'hbs',
|
||||
},
|
||||
opts = {},
|
||||
},
|
||||
{
|
||||
'gbprod/substitute.nvim',
|
||||
@@ -361,6 +370,68 @@ local plugins = {
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
'folke/todo-comments.nvim',
|
||||
event = { 'BufReadPre', 'BufNewFile' },
|
||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||
opts = {
|
||||
highlight = {
|
||||
multiline = false, -- I usually only want one line to be highlighted
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
'<leader>tT',
|
||||
function()
|
||||
require('snacks').picker.todo_comments({ keywords = { 'TODO' } })
|
||||
end,
|
||||
desc = 'Todo',
|
||||
},
|
||||
{
|
||||
'<leader>tF',
|
||||
function()
|
||||
require('snacks').picker.todo_comments({ keywords = { 'FIX', 'FIXME' } })
|
||||
end,
|
||||
desc = 'Fix/Fixme',
|
||||
},
|
||||
{
|
||||
'<leader>tN',
|
||||
function()
|
||||
require('snacks').picker.todo_comments({ keywords = { 'NOTE' } })
|
||||
end,
|
||||
desc = 'Note',
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
local todo_comments = require('todo-comments')
|
||||
|
||||
todo_comments.setup({
|
||||
keywords = {
|
||||
FIX = {
|
||||
icon = ' ', -- icon used for the sign, and in search results
|
||||
color = 'error', -- can be a hex color, or a named color (see below)
|
||||
alt = { 'FIXME', 'BUG', 'FIXIT', 'ISSUE' }, -- a set of other keywords that all map to this FIX keywords
|
||||
-- signs = false, -- configure signs for some keywords individually
|
||||
},
|
||||
TODO = { icon = ' ', color = 'info' },
|
||||
HACK = { icon = ' ', color = 'warning', alt = { 'DON SKIP' } },
|
||||
WARN = { icon = ' ', color = 'warning', alt = { 'WARNING', 'XXX' } },
|
||||
PERF = { icon = ' ', alt = { 'OPTIM', 'PERFORMANCE', 'OPTIMIZE' } },
|
||||
NOTE = { icon = ' ', color = 'hint', alt = { 'INFO', 'READ', 'COLORS' } },
|
||||
TEST = { icon = '⏲ ', color = 'test', alt = { 'TESTING', 'PASSED', 'FAILED' } },
|
||||
},
|
||||
})
|
||||
|
||||
-- keymaps
|
||||
vim.keymap.set('n', ']t', function()
|
||||
todo_comments.jump_next()
|
||||
end, { desc = 'Next todo comment' })
|
||||
|
||||
vim.keymap.set('n', '[t', function()
|
||||
todo_comments.jump_prev()
|
||||
end, { desc = 'Previous todo comment' })
|
||||
end,
|
||||
},
|
||||
{
|
||||
'2kabhishek/pickme.nvim',
|
||||
cmd = 'PickMe',
|
||||
|
||||
Reference in new issue
Block a user