nvim-comment
nvim-comment copied to clipboard
Autohotkey/AHK files not getting commented.
Shows commentstring not understood.
@leet0rz, You can have nvim-comment work with AHK files by creating an autocommand that sets the AHK commentstring
buffer option, thus letting nvim-comment
know how to recognize AHK comments.
E.g., somewhere in your init.lua
path, try adding
vim.api.nvim_create_augroup("comment", { clear = true })
vim.api.nvim_create_autocmd({"BufEnter", "BufFilePost"}, {
group = "comment",
pattern = {"*.ahk"},
callback = function()
vim.api.nvim_buf_set_option(0, "commentstring", "; %s")
end
})
I would personally stick this in my lua/plugins/nvimcomment.lua
config file.