From 71a8ee4189ae1d02f269fe758e770282a6cbb11b Mon Sep 17 00:00:00 2001 From: Soispha Date: Sun, 27 Aug 2023 20:49:20 +0200 Subject: Fix(hm/conf/nvim/plugins/todo-comments): Add default highlighting --- .../plugins/colorscheme/lua/mk_todos_readable.lua | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'hm') diff --git a/hm/soispha/conf/nvim/plugins/colorscheme/lua/mk_todos_readable.lua b/hm/soispha/conf/nvim/plugins/colorscheme/lua/mk_todos_readable.lua index 0145ec19..ee28151c 100644 --- a/hm/soispha/conf/nvim/plugins/colorscheme/lua/mk_todos_readable.lua +++ b/hm/soispha/conf/nvim/plugins/colorscheme/lua/mk_todos_readable.lua @@ -1,5 +1,17 @@ -local opts = { bg = "NONE"; fg = "fg"; } -vim.api.nvim_set_hl(0, "@text.danger", opts) -vim.api.nvim_set_hl(0, "@text.note", opts) -vim.api.nvim_set_hl(0, "@text.todo", opts) -vim.api.nvim_set_hl(0, "@text.warning", opts) +local opts = { bg = "NONE"; bold = true; } + + +---@param hl_group string: The name of the hl group +---@param extra_opts table: Extra options to pass to nvim_set_hl +local set_hl = function(hl_group, extra_opts) + local local_opts = vim.deepcopy(opts); + for k, v in ipairs(extra_opts) do + local_opts[k] = v; + end + vim.api.nvim_set_hl(0, hl_group, local_opts) +end + +set_hl("@text.danger", { fg = "red"; }) +set_hl("@text.note", { fg = "blue"; }) +set_hl("@text.todo", { fg = "green"; }) +set_hl("@text.warning", { fg = "yellow"; }) -- cgit 1.4.1