-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(plugins)!: new configuration for todo-comments plugin
- Loading branch information
Showing
1 changed file
with
30 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" }) |