numToStr / Comment.nvim

:brain: :muscle: // Smart and powerful comment plugin for neovim. Supports treesitter, dot repeat, left-right/up-down motions, hooks, and more
MIT License
3.86k stars 152 forks source link

ft.set() not working for blade files defaults to html comments #436

Open shaheenfawzy opened 7 months ago

shaheenfawzy commented 7 months ago

can't add custom filetype blade comments here is my config

return {
  {
    "numToStr/Comment.nvim",
    lazy = false,
    config = function()
      local ft = require("Comment.ft")

      ft.set("blade", "{{-- %s --}}")

      require("Comment").setup()
    end,
  },
}
cdarken commented 6 months ago

Same here. I have also added smarty and that one works. I suppose you're using the work in progress repository from EmranMR for blade support. Maybe Comment.nvim doesn't detect the file type correctly, I don't know if it has anything to do with tree-sitter.

ZayRTun commented 2 weeks ago

If your working exclusively with blade, then the following seems to work

  {
    'numToStr/Comment.nvim',

    config = function()
      local ft = require 'Comment.ft'

      ft.set('html', { '{{-- %s --}}', '{{-- %s --}}' })

      require('Comment').setup()
    end,
  },