From 3f4c057ffe03755dc480423d385c78c85ca760f4 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Thu, 12 Jun 2025 10:13:52 +0200 Subject: [PATCH] nvim: Add option switch to italicize/normalize comments --- nvim/.config/nvim/lua/plugins/base.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/nvim/.config/nvim/lua/plugins/base.lua b/nvim/.config/nvim/lua/plugins/base.lua index da44839..a83507a 100644 --- a/nvim/.config/nvim/lua/plugins/base.lua +++ b/nvim/.config/nvim/lua/plugins/base.lua @@ -289,6 +289,22 @@ return { end, desc = "floating file browser", }, + { + "[oi", + function() + local c = vim.api.nvim_get_hl(0, { name = "Comment" }) + vim.api.nvim_set_hl(0, "Comment", vim.tbl_extend("force", c, { italic = false })) + end, + desc = "no italic comments", + }, + { + "]oi", + function() + local c = vim.api.nvim_get_hl(0, { name = "Comment" }) + vim.api.nvim_set_hl(0, "Comment", vim.tbl_extend("force", {}, c, { italic = true })) + end, + desc = "italic comments", + }, }, }, -- try to avoid putting files in util buffers, e.g. filetree, aerial, undotree, ..