nvim-highlight-colors icon indicating copy to clipboard operation
nvim-highlight-colors copied to clipboard

[Feature Request] configuration per filetype

Open doongjohn opened this issue 3 years ago • 2 comments

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';
  }
}

doongjohn avatar Sep 24 '22 07:09 doongjohn

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!

andrewferrier avatar Apr 18 '23 15:04 andrewferrier

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.

image

~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.

fnune avatar Mar 27 '24 12:03 fnune

This is the only thing keeping me from switching from my fork of nvchad/n

catgoose avatar May 18 '24 22:05 catgoose

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

image

I understand this is not necessarily what you all wanted. But I hope this will at least open up the customization a little bit 😺

brenoprata10 avatar May 23 '24 13:05 brenoprata10