From 416dce6b9ea46a570f0d3eeafd2650f0e5bb0ee5 Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Mon, 22 Jun 2026 01:35:58 +0300 Subject: 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 +++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) (limited to '.config/nvim/lua/plugins/snacks.lua') 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', + }, }, } -- cgit v1.3.1