From 07e6061b84971b55af75e7244c4bfb3555ebfe12 Mon Sep 17 00:00:00 2001 From: Patrick Date: Wed, 21 Aug 2024 23:40:39 +0200 Subject: [PATCH] configured colorizer --- init.lua | 3 +++ lua/config/looks.lua | 1 + lua/plugins/tooling.lua | 19 +++++++++++++++++++ 3 files changed, 23 insertions(+) create mode 100644 lua/config/looks.lua diff --git a/init.lua b/init.lua index 6b25163..4b7c96a 100644 --- a/init.lua +++ b/init.lua @@ -1,4 +1,7 @@ +require("config.looks") + require("config.lazy") require("config.behaviour") require("config.keymap") + diff --git a/lua/config/looks.lua b/lua/config/looks.lua new file mode 100644 index 0000000..fd03383 --- /dev/null +++ b/lua/config/looks.lua @@ -0,0 +1 @@ +vim.o.termguicolors = true diff --git a/lua/plugins/tooling.lua b/lua/plugins/tooling.lua index 52be722..337e66d 100644 --- a/lua/plugins/tooling.lua +++ b/lua/plugins/tooling.lua @@ -1,6 +1,25 @@ return { { + -- Package installer (for LSPs) "williamboman/mason.nvim", opts = {} }, + { + -- Highlight color codes (like #A3F041) + "norcalli/nvim-colorizer.lua", + -- event = { "BufNew" }, -- will not call autocmd when opening a file the first time + config = function() + require("colorizer").setup({'*'}, { RRGGBBAA = true }) + + -- trigger highlighting when opening a new buffer + vim.api.nvim_create_autocmd( + { "BufNew", "BufRead" }, + { + callback = function() + local colorizer = require("colorizer") + colorizer.attach_to_buffer(0, colorizer.get_buffer_options(0)) + end + }) + end, + } }