✨ feat: add todo-comments plugin for enhanced code annotation

This commit is contained in:
sankalp committed 2025-07-25 23:43:57 +05:45
1 parent 58f00fa2cf
commit 3c632e939d
3 files changed
+80 -4

No files matched your search

+75 -4
View File
@@ -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',
+1
View File
@@ -55,6 +55,7 @@
"sniprun": { "branch": "master", "commit": "a90c65846c3c18efc3f799d8b6dc26af9d4a69ed" },
"substitute.nvim": { "branch": "main", "commit": "9db749a880e3dd3b0eb57f698aa8f1e1630e1f25" },
"termim.nvim": { "branch": "main", "commit": "e4bcf977bef6f6c79996e38fcb9faeccd912007c" },
"todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" },
"toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" },
"treesj": { "branch": "main", "commit": "3b4a2bc42738a63de17e7485d4cc5e49970ddbcc" },
"ui": { "branch": "v3.0", "commit": "dc4950f5bd4117e2da108b681506c908b93d4a62" },
+4
View File
@@ -162,6 +162,10 @@ Snacks.setup({
prompt_pos = 'title',
win = { style = 'picker' },
expand = true,
matchers = {
frecency = true,
cwd_bonus = false,
},
sources = {
-- layout options: dropdown, horizontal, vertical, vscode, ivy, ivy_split, telescope, top, left, right, bottom, sidebar
buffers = { layout = files_layout() },