return { -- Some commands to remember when dealing with highlight-groups: -- :filter GroupPrefix highlight -- :put =execute('highlight') { -- https://github.com/catgoose/nvim-colorizer.lua "catgoose/nvim-colorizer.lua", cmd = "ColorizerToggle", opts = { options = { parsers = { custom = { -- parses color230 etc { name = "xterm_color_name", prefixes = { "color" }, parse = function(ctx) local num = ctx.line:match("color(%d%d?%d?)", ctx.col) if not num then return end local n = tonumber(num) if not n or n < 0 or n > 255 then return end local len = #"color" + #num local next = ctx.line:sub(ctx.col + len, ctx.col + len) if next:match("[%w_]") then return end local _, hex = require("colorizer.parser.xterm").parser("#x" .. num, 1) if hex then return len, hex end end, }, }, }, }, }, config = function(_, opts) require("colorizer").setup(opts) -- execute colorizer as soon as possible vim.defer_fn(function() require("colorizer").attach_to_buffer(0) end, 0) end, }, }