From 416dce6b9ea46a570f0d3eeafd2650f0e5bb0ee5 Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Mon, 22 Jun 2026 01:35:58 +0300 Subject: [PATCH] todo-comments with snack broke for some reason, idk when, I guess I can no longer use it then, welp --- .config/nvim/lua/plugins/snacks.lua | 83 ++++++++++++++++++++++ .config/nvim/lua/plugins/todo-comments.lua | 78 ++++++++++---------- 2 files changed, 122 insertions(+), 39 deletions(-) diff --git a/.config/nvim/lua/plugins/snacks.lua b/.config/nvim/lua/plugins/snacks.lua index aa942f9..9241b82 100644 --- a/.config/nvim/lua/plugins/snacks.lua +++ b/.config/nvim/lua/plugins/snacks.lua @@ -414,5 +414,88 @@ return { end, desc = 'Toggle [T]erminal', }, + + { + 'st', + function() + -- vim.cmd('TodoLocListq') + require('snacks').picker({ + layout = 'telescope', + follow = true, + hidden = true, + finder = 'proc', + cmd = 'rg', + args = { + '--color=never', + '--no-heading', + '--with-filename', + '--line-number', + '--column', + '--hidden', + '--follow', + -- The immutable background filter pattern + [[\b(TODO|FIXME|BUG|HACK)\b]], + }, + -- Transform raw ripgrep text output into structured items snacks can read + transform = function(item) + local file, line, col, text = item.text:match('^([^:]+):(%d+):(%d+):(.*)$') + if file then + item.file = file + item.pos = { tonumber(line), tonumber(col) - 1 } + item.text = text + end + return item + end, + -- Custom mapping injection + win = { + input = { + keys = { + [''] = { 'confirm', mode = { 'n', 'i' } }, + }, + }, + list = { + keys = { + [''] = 'confirm', + }, + }, + }, + }) + -- Snacks.picker.grep({ + -- layout = 'telescope', + -- follow = true, + -- hidden = true, + -- keywords = { 'TODO', 'WIP', 'FIX', 'FIXME', 'OPTIMIZE', 'SECURE' }, + -- args = { '--regexp', '\\b(TODO|FIXME|BUG|HACK)\\b' }, + -- }) + end, + desc = '[S]earch [T]odos', + }, + { + 'sn', + function() + Snacks.picker.todo_comments({ + layout = 'telescope', + follow = true, + hidden = true, + keywords = { + 'NOTE', + 'INFO', + 'DOCS', + 'TEST', + 'WARN', + 'WARNING', + 'SECURITY', + 'HACK', + 'IMPORTANT', + 'PERF', + 'STUDY', + 'UNSAFE', + 'SAFETY', + 'ERROR', + }, + }) + end, + desc = '[S]earch [N]otes', + }, }, } diff --git a/.config/nvim/lua/plugins/todo-comments.lua b/.config/nvim/lua/plugins/todo-comments.lua index 17ad1cf..8ee1a65 100644 --- a/.config/nvim/lua/plugins/todo-comments.lua +++ b/.config/nvim/lua/plugins/todo-comments.lua @@ -3,45 +3,45 @@ return { dependencies = { 'nvim-lua/plenary.nvim' }, event = 'VeryLazy', keys = { - { - 'st', - function() - Snacks.picker.todo_comments({ - layout = 'telescope', - follow = true, - hidden = true, - keywords = { 'TODO', 'WIP', 'FIX', 'FIXME', 'OPTIMIZE', 'SECURE' }, - }) - end, - desc = '[S]earch [T]odos', - }, - { - 'sn', - function() - Snacks.picker.todo_comments({ - layout = 'telescope', - follow = true, - hidden = true, - keywords = { - 'NOTE', - 'INFO', - 'DOCS', - 'TEST', - 'WARN', - 'WARNING', - 'SECURITY', - 'HACK', - 'IMPORTANT', - 'PERF', - 'STUDY', - 'UNSAFE', - 'SAFETY', - 'ERROR', - }, - }) - end, - desc = '[S]earch [N]otes', - }, + -- { + -- 'st', + -- function() + -- Snacks.picker.todo_comments({ + -- layout = 'telescope', + -- follow = true, + -- hidden = true, + -- keywords = { 'TODO', 'WIP', 'FIX', 'FIXME', 'OPTIMIZE', 'SECURE' }, + -- }) + -- end, + -- desc = '[S]earch [T]odos', + -- }, + -- { + -- 'sn', + -- function() + -- Snacks.picker.todo_comments({ + -- layout = 'telescope', + -- follow = true, + -- hidden = true, + -- keywords = { + -- 'NOTE', + -- 'INFO', + -- 'DOCS', + -- 'TEST', + -- 'WARN', + -- 'WARNING', + -- 'SECURITY', + -- 'HACK', + -- 'IMPORTANT', + -- 'PERF', + -- 'STUDY', + -- 'UNSAFE', + -- 'SAFETY', + -- 'ERROR', + -- }, + -- }) + -- end, + -- desc = '[S]earch [N]otes', + -- }, }, opts = { signs = false,