nvim-highlight-colors
nvim-highlight-colors copied to clipboard
[Feature Request] configuration per filetype
https://github.com/norcalli/nvim-colorizer.lua#customization
-- Attach to certain Filetypes, add special configuration for `html`
-- Use `background` for everything else.
require 'colorizer'.setup {
'css';
'javascript';
html = {
mode = 'foreground';
}
}
Agreed, this would be great. As an example, nvim-highlight-colors throws false positives right now on line numbers in https://github.com/elihunter173/dirbuf.nvim/ buffers, so it would be great to have a way to turn it off for specific filetypes.
Thanks for your hard work on this plugin!
Would appreciate this. It's necessary for several views, e.g. othe lazy.nvim pop-over, where I would love to be able to simply disable the plugin.
~EDIT: realizing now that I can probably just use Lazy's ft option (https://github.com/folke/lazy.nvim?tab=readme-ov-file#-plugin-spec)~. Never mind, it works as an allow-list.
This is the only thing keeping me from switching from my fork of nvchad/n
Hey o/
I do not really plan to support the same structure as colorizer. My goal is to keep the plugin as lightweight and easy to maintain as possible. Otherwise, I might feel unmotivated to keep improving it.
I've just pushed the following PR: https://github.com/brenoprata10/nvim-highlight-colors/pull/87
This PR adds a bunch of options to customize the plugin. Like enable_hex, enable_rgb...
There is a function within vim API which will return the buffer type of the currently opened buffer
vim.bo.filetype
If you make use of vim.bo.filetype. You can actually turn on/off specific options based on the filetype.
Example of how to disable hex color for buffer of type text
I understand this is not necessarily what you all wanted. But I hope this will at least open up the customization a little bit 😺