Skip to content

Commit

Permalink
refactor(plugins)!: new configuration for todo-comments plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
ecosse3 committed Jul 14, 2024
1 parent e1d374f commit 8469d63
Showing 1 changed file with 30 additions and 34 deletions.
64 changes: 30 additions & 34 deletions lua/plugins/todo-comments.lua
Original file line number Diff line number Diff line change
@@ -1,36 +1,32 @@
local status_ok, todo_comments = pcall(require, "todo-comments")
if not status_ok then
return
end

-- ╭──────────────────────────────────────────────────────────╮
-- │ Setup │
-- ╰──────────────────────────────────────────────────────────╯
todo_comments.setup {
signs = true, -- show icons in the signs column
sign_priority = 8, -- sign priority
-- keywords recognized as todo comments
keywords = {
FIX = {
alt = { "FIXME", "BUG", "FIXIT", "ISSUE" }, -- a set of other keywords that all map to this FIX keywords
return {
{
"folke/todo-comments.nvim",
lazy = false,
event = "BufEnter",
opts = {
signs = true, -- show icons in the signs column
sign_priority = 8, -- sign priority
-- keywords recognized as todo comments
keywords = {
FIX = {
alt = { "FIXME", "BUG", "FIXIT", "ISSUE" }, -- a set of other keywords that all map to this FIX keywords
},
WARN = { alt = { "WARNING" } },
PERF = { alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } },
},
highlight = {
before = "", -- "fg" or "bg" or empty
keyword = "wide", -- "fg", "bg", "wide" or empty. (wide is the same as bg, but will also highlight surrounding characters)
after = "fg", -- "fg" or "bg" or empty
pattern = [[.*<(KEYWORDS)\s*:]], -- pattern or table of patterns, used for highlightng (vim regex)
comments_only = true, -- uses treesitter to match keywords in comments only
max_line_len = 400, -- ignore lines longer than this
exclude = {}, -- list of file types to exclude highlighting
},
},
WARN = { alt = { "WARNING" } },
PERF = { alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } },
},
highlight = {
before = "", -- "fg" or "bg" or empty
keyword = "wide", -- "fg", "bg", "wide" or empty. (wide is the same as bg, but will also highlight surrounding characters)
after = "fg", -- "fg" or "bg" or empty
pattern = [[.*<(KEYWORDS)\s*:]], -- pattern or table of patterns, used for highlightng (vim regex)
comments_only = true, -- uses treesitter to match keywords in comments only
max_line_len = 400, -- ignore lines longer than this
exclude = {}, -- list of file types to exclude highlighting
},
keys = {
{ "n", "]t", function() require("todo-comments").jump_next() end, { desc = "Next todo comment" } },
{ "n", "[t", function() require("todo-comments").jump_prev() end, { desc = "Previous todo comment" } }
}
}
}

-- ╭──────────────────────────────────────────────────────────╮
-- │ Keymappings │
-- ╰──────────────────────────────────────────────────────────╯

vim.keymap.set("n", "]t", function() require("todo-comments").jump_next() end, { desc = "Next todo comment" })
vim.keymap.set("n", "[t", function() require("todo-comments").jump_prev() end, { desc = "Previous todo comment" })

0 comments on commit 8469d63

Please sign in to comment.