norcalli / nvim-colorizer.lua

The fastest Neovim colorizer.
Other
2.25k stars 117 forks source link

Unable to customize '*' #23

Closed meain closed 4 years ago

meain commented 4 years ago
require 'colorizer'.setup ({
  '*';
  css = { names = true; };
}, {
  names = false;
  rgb_fn = true;
  hsl_fn = true;
})

I tried doing this. I am hoping to get non name highlights everywhere and every kind of highlight in css.

I am still getting name highlight in all buffers.

I don't know much lua. But I tried something like this. Did not work either.

config = {}
config['*'] = { names = false }
config['css'] = { names = true }
require 'colorizer'.setup (config, {
  rgb_fn = true;
  hsl_fn = true;
})
norcalli commented 4 years ago

Can you check what version you are using in the folder it's installed? You can do this by checking the git revision. If you don't know how to get the git revision, it would be git log | head -n1. I suspect that your version isn't respecting the options.

Yeah, '*' is more like a fake FileType that is only used to signal that you want to attach to all FileTypes. Semantically, customizing '*' would be the exact same thing as setting default options. Hence, you should use the default options for things you want to put on the '*' customization.

meain commented 4 years ago

My bad. I had an older version. This works after upgrade.