summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/extra/colorizer.lua
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2021-08-10 23:15:04 +0200
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2021-08-10 23:15:04 +0200
commit540268d618627079c9b958a955b586e1888b46a8 (patch)
tree1a22a5feb457135178b9d4fe8b6c1755f5ca66bc /.config/nvim/lua/extra/colorizer.lua
parente79bd3273f58ba38e8fcd716090b89326791afbb (diff)
Major refactor of nvim
Diffstat (limited to '.config/nvim/lua/extra/colorizer.lua')
-rw-r--r--.config/nvim/lua/extra/colorizer.lua22
1 files changed, 22 insertions, 0 deletions
diff --git a/.config/nvim/lua/extra/colorizer.lua b/.config/nvim/lua/extra/colorizer.lua
new file mode 100644
index 0000000..04b7367
--- /dev/null
+++ b/.config/nvim/lua/extra/colorizer.lua
@@ -0,0 +1,22 @@
+local M = {}
+local Log = require "core.log"
+
+M.config = function()
+ local status_ok, colorizer = pcall(require, "colorizer")
+ if not status_ok then
+ Log:get_default().error "Failed to load colorizer"
+ return
+ end
+
+ colorizer.setup({ "*" }, {
+ RGB = true, -- #RGB hex codes
+ RRGGBB = true, -- #RRGGBB hex codes
+ RRGGBBAA = true, -- #RRGGBBAA hex codes
+ rgb_fn = true, -- CSS rgb() and rgba() functions
+ hsl_fn = true, -- CSS hsl() and hsla() functions
+ css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB
+ css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn
+ })
+end
+
+return M