nvim-comment icon indicating copy to clipboard operation
nvim-comment copied to clipboard

Autohotkey/AHK files not getting commented.

Open leet0rz opened this issue 1 year ago • 1 comments

Shows commentstring not understood.

leet0rz avatar Oct 04 '23 21:10 leet0rz

@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.

oneroyalace avatar Oct 13 '23 19:10 oneroyalace