Prevent any highlighting in buffers that don't have a filetype, even with `highlighter.auto_enable` set to true
Request for additional color space
No response
Request for other features
I use your plugin just to provide some simple color highlighting on color codes inside neovim, and for that task it works pretty well. In my config, I have the highlighter.auto_enable option set to true, so I get highlighting in any file I'm working on. But it seems that this also enables highlighting on buffers with no filetype, in particular terminals.
I've had issues with highlighting being turned on automatically inside a terminal; namely, commands like yes that print a bunch of lines to the terminal really really quickly will cause the terminal to visually hang, until I press Ctrl-C, and then I see the last text printed by the command before I stopped it.
I have this in my lazy config right now as a workaround:
{
"uga-rosa/ccc.nvim",
opts = {
auto_enable = false,
lsp = true,
preserve = true,
alpha = "auto",
highlighter = {
auto_enable = true,
excludes = {""}, -- Preventing buffers that don't have a file type (e.g. terminals)
-- from being highlighted.
},
},
},
I think having the sensible default of not doing any highlighting at all on these kind of buffers would be a good idea, as well as some extra config option in the highlighter group for specifying certain buffer types that don't have a filetype to be highlighted anyway. I think this issue that talked about adding a way to exclude buffers of a certain buftype could work here too, but maybe alongside that, an option like highlighter.buftypes, to compliment the highlighter.filetypes option that already exists could be really nice to have. Or if that won't work, have an option, like highlighter.allow_no_filetype or something like that, that when set to true, will force it to highlight buffers without a filetype unless there's something in highlighter.excludes that says otherwise like I did.