From 433cd2117519375e93d92c79690a66ea46b84f25 Mon Sep 17 00:00:00 2001 From: JP Appel Date: Thu, 22 Aug 2024 19:38:29 -0400 Subject: configured todo-comments and moved filetypes specific plugins --- nvim/lua/plugins/todos.lua | 92 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 nvim/lua/plugins/todos.lua (limited to 'nvim/lua/plugins/todos.lua') diff --git a/nvim/lua/plugins/todos.lua b/nvim/lua/plugins/todos.lua new file mode 100644 index 0000000..1e5d4ad --- /dev/null +++ b/nvim/lua/plugins/todos.lua @@ -0,0 +1,92 @@ +return { + 'folke/todo-comments.nvim', + dependencies = { "nvim-lua/plenary.nvim", "folke/trouble.nvim" }, + opts = {}, + cmd = { + 'TodoQuickFix', + 'TodoLocList', + 'TodoTrouble', + 'TodoTelescope' + }, + keys = { + { + "tf", + function() + local trouble = require("trouble") + local opts = { + mode = "todo", + focus = true, + follow = false + } + if trouble.is_open(opts) then + if vim.o.ft == "trouble" then + trouble.close(opts) + else + trouble.focus() + end + else + trouble.open(opts) + end + end, + mode = 'n', + desc = "Open todo comments in a trouble window" + }, + { + "tF", + function() + local trouble = require("trouble") + local opts = { + mode = "todo", + focus = true, + follow = false, + filter = { buf = 0 } + } + if trouble.is_open(opts) then + if vim.o.ft == "trouble" then + trouble.close(opts) + else + trouble.focus() + end + else + trouble.open(opts) + end + end, + mode = 'n', + desc = "Open buffer local todo comments in a trouble window" + }, + { + "tq", + "TodoQuickFix", + mode = 'n', + desc = "Quickfix List (Todo Comments)" + }, + { + "tl", + "TodoLocList", + mode = 'n', + desc = "Location List (Todo Comments)" + }, + { + "]t", + function() + require('trouble').next({ mode = "todo", jump = true }) + end, + mode = 'n', + desc = "Next todo comment" + }, + { + "[t", + function() + require('trouble').prev({ mode = "todo", jump = true }) + end, + mode = 'n', + desc = "Previous todo comment" + }, + { + "ft", + "TodoTelescope", + mode = 'n', + desc = "Open Todos in quickfix list" + } + } +} -- cgit v1.2.3