Skip to content

Commit

Permalink
Make todo-comments.nvim more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
Jendker committed Aug 21, 2024
1 parent eeef00a commit 0de650a
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions nvim/lua/plugins.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1286,25 +1286,38 @@ local plugins = {
},
{
"folke/todo-comments.nvim",
cmd = { "TodoTrouble", "TodoTelescope" },
event = { "BufReadPre", "BufNewFile" },
event = { "VeryLazy" },
keys = {
{ "]t", function() require("todo-comments").jump_next() end, desc = "Next todo comment" },
{ "[t", function() require("todo-comments").jump_prev() end, desc = "Previous todo comment" },
{ "<leader>xt", ':exe ":TodoTrouble cwd=" .. fnameescape(expand("%:p"))<cr>', desc = "Todo (Trouble) current file", silent = true },
{ "<leader>xT", "<cmd>TodoTrouble<cr>", desc = "Todo (Trouble) in workspace", silent = true },
{ "<leader>xt", '<cmd>Trouble todo toggle filter = {buf = 0}<cr>', desc = "Todo (Trouble) current file", silent = true },
{ "<leader>xT", '<cmd>Trouble todo toggle<cr>', desc = "Todo (Trouble) in workspace", silent = true },
{ "<leader>st", ':exe ":TodoTelescope cwd=" .. fnameescape(expand("%:p"))<cr>', desc = "Todo current file", silent = true },
{ "<leader>sT", "<cmd>TodoTelescope<cr>", desc = "Todo in workspace", silent = true },
},
opts = {
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" },
WARN = { icon = "", color = "warning", alt = { "WARNING", "XXX" } },
PERF = { icon = "", alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } },
NOTE = { icon = "", color = "hint", alt = { "INFO" } },
},
merge_keywords = false, -- to make sure that the keywords above override the default
highlight = {
multiline = false, -- rarely useful
pattern = [[.*<(KEYWORDS)\s*(\s|:)]],
pattern = [[.*<(KEYWORDS)>\s*]],
keyword = "fg", -- make it less flashy
},
search = {
pattern = [[\b(KEYWORDS)(\s|:)]],
}
},
},
cond = not_vscode
},
Expand Down

0 comments on commit 0de650a

Please sign in to comment.