folke / ts-comments.nvim

Tiny plugin to enhance Neovim's native comments
Apache License 2.0
351 stars 23 forks source link

Question: Force a commentstring for filetype? #35

Closed eirabben closed 4 months ago

eirabben commented 4 months ago

Is there any way to force a filetype to use a certain commentstring, even though there are different TS languages inside the file?

An example is a twig file, like this:

{% for item in items %}
  <div>
    {{ item.title }}
  </div>
{% endfor %}

In this case I would always want a twig style comment ({# %s #}), even if commenting the html parts.

folke commented 4 months ago

First of all, please use discussions for user questions next time. Adding the commentstring to lang with ft shoyld wok