Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autohotkey/AHK files not getting commented. #57

Open
leet0rz opened this issue Oct 4, 2023 · 1 comment
Open

Autohotkey/AHK files not getting commented. #57

leet0rz opened this issue Oct 4, 2023 · 1 comment

Comments

@leet0rz
Copy link

leet0rz commented Oct 4, 2023

Shows commentstring not understood.

@oneroyalace
Copy link

@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 added a commit to oneroyalace/nvim-comment that referenced this issue Oct 13, 2023
This commit updates the README with instructions for using Neovim's native API for setting autocmds.

The README updates should address issues like terrortylor#57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants