From c3aeaf76ee12ea3272310d831edd8eed7447c258 Mon Sep 17 00:00:00 2001 From: punkfairie Date: Wed, 1 Jan 2025 17:53:11 -0800 Subject: [PATCH] feat: todo-comments.nvim --- nix/neovim-overlay.nix | 1 + nvim/lua/plugins/editor/init.lua | 1 + .../lua/plugins/editor/todo-comments-nvim.lua | 39 +++++++++++++++++++ 3 files changed, 41 insertions(+) create mode 100644 nvim/lua/plugins/editor/todo-comments-nvim.lua diff --git a/nix/neovim-overlay.nix b/nix/neovim-overlay.nix index a685ec0..00b6e37 100644 --- a/nix/neovim-overlay.nix +++ b/nix/neovim-overlay.nix @@ -53,6 +53,7 @@ with final.pkgs.lib; let which-key-nvim gitsigns-nvim trouble-nvim + todo-comments-nvim aerial-nvim # Treesitter diff --git a/nvim/lua/plugins/editor/init.lua b/nvim/lua/plugins/editor/init.lua index 8323854..d3083e6 100644 --- a/nvim/lua/plugins/editor/init.lua +++ b/nvim/lua/plugins/editor/init.lua @@ -6,6 +6,7 @@ return { req('gitsigns-nvim'), req('grug-far-nvim'), req('neo-tree-nvim'), + req('todo-comments-nvim'), req('trouble-nvim'), req('which-key-nvim'), } diff --git a/nvim/lua/plugins/editor/todo-comments-nvim.lua b/nvim/lua/plugins/editor/todo-comments-nvim.lua new file mode 100644 index 0000000..f2e98ae --- /dev/null +++ b/nvim/lua/plugins/editor/todo-comments-nvim.lua @@ -0,0 +1,39 @@ +return { + 'todo-comments.nvim', + event = { 'BufReadPost', 'BufWritePost', 'BufNewFile' }, + cmd = { 'TodoTrouble', 'TodoTelescope' }, + keys = { + { 'st', 'TodoTelescope', desc = 'todo search' }, + { + 'sT', + 'TodoTelescope keywords=TODO,FIX,FIXME', + desc = 'todo/fix/fixme search', + }, + { 'xt', 'Trouble todo toggle', desc = 'todo' }, + { + 'xT', + 'Trouble todo toggle filter = {tag = {TODO,FIX,FIXME}}', + desc = 'todo/fix/fixme', + }, + { + ']t', + function() + require('todo-comments').jump_prev() + end, + desc = 'previous todo', + }, + { + ']t', + function() + require('todo-comments').jump_next() + end, + desc = 'next todo', + }, + }, + before = function() + require('lz.n').trigger_load({ 'trouble.nvim' }) + end, + after = function() + require('todo-comments').setup({}) + end, +}