terrortylor / nvim-comment

A comment toggler for Neovim, written in Lua
MIT License
479 stars 23 forks source link

Add support to htmldjango files #56

Open DMunkei opened 1 year ago

DMunkei commented 1 year ago

Hi, adding a single line comments to htmldjango files was straight forward as it was explained in the docs. However, I couldn't find something to add block comment marks.

require'nvim_comment'.setup(
    {
        hook = function()
            if vim.api.nvim_buf_get_option(0, "filetype") == "htmldjango" then
                -- Assumes this is being run in the context of the filetype...
                vim.api.nvim_buf_set_option(0, "commentstring", "{# %s #}")
            end
        end
    }
)
{% comment %} 
<div>
     <p>foo</p>
</div>
{% endcomment %}

This is an example how a block comment should look like. If you point me towards the proper position in the source code, I could try adding it and creating a PR?