-
Contributing guidelines
Module(s)mini.comment QuestionWhile working on my code I found out that mini.comment() object commentstring is empty. I was able to fix it by explicitly setting require("mini.comment").setup({
hooks = {
pre = function()
local ft = vim.bo.filetype
if ft == "verilog" or ft == "systemverilog" or ft == "arduino" then
vim.bo.commentstring = "// %s"
end
end,
},
}) Not sure if this is a bug, a missing default configuration, or a dependency issue. Should this be handled internally by |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
@usman1515 It's not a bug or a missing dependency. The issue is that Neovim doesn't define vim.opt_local.commentstring = "; %s" I'm sure this is not related to For example, Rust and Python have
Yes, you need to set it manually. Neovim doesn't define it by default for these file types. |
Beta Was this translation helpful? Give feedback.
@usman1515 It's not a bug or a missing dependency. The issue is that Neovim doesn't define
commentstring
for these file types by default. I had the same problem withyuck
andlisp
.mini.comment
didn't work until I creatednvim/after/ftplugin/yuck.lua
with:I'm sure this is not related to
mini.comment
. The real issue is that Neovim doesn't setcommentstring
for Arduino or SystemVerilog by default.For example, Rust and Python have
commentstring
set automatically because Neovim already supports them.Yes, you need to set it manually. Neovim doesn't define it by default …