From 5a12e18867dc2e3fb605c08ee8f5b3c6634a54ea Mon Sep 17 00:00:00 2001 From: Raoul Branten Date: Fri, 31 Jan 2025 13:47:33 +0100 Subject: [PATCH] Set up colorizer plugin --- lua/core/plugin_config/colorizer.lua | 37 ++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/lua/core/plugin_config/colorizer.lua b/lua/core/plugin_config/colorizer.lua index e69de29..9a8e0a4 100644 --- a/lua/core/plugin_config/colorizer.lua +++ b/lua/core/plugin_config/colorizer.lua @@ -0,0 +1,37 @@ +-- Attaches to every FileType mode +require 'colorizer'.setup() + +-- Attach to certain Filetypes, add special configuration for `html` +-- Use `background` for everything else. +require 'colorizer'.setup { + 'css'; + 'javascript'; + html = { + mode = 'foreground'; + } +} + +-- Use the `default_options` as the second parameter, which uses +-- `foreground` for every mode. This is the inverse of the previous +-- setup configuration. +require 'colorizer'.setup({ + 'css'; + 'javascript'; + html = { mode = 'background' }; +}, { mode = 'foreground' }) + +-- Use the `default_options` as the second parameter, which uses +-- `foreground` for every mode. This is the inverse of the previous +-- setup configuration. +require 'colorizer'.setup { + '*'; -- Highlight all files, but customize some others. + css = { rgb_fn = true; }; -- Enable parsing rgb(...) functions in css. + html = { names = false; } -- Disable parsing "names" like Blue or Gray +} + +-- Exclude some filetypes from highlighting by using `!` +require 'colorizer'.setup { + '*'; -- Highlight all files, but customize some others. + '!vim'; -- Exclude vim from highlighting. + -- Exclusion Only makes sense if '*' is specified! +}