1
0

replace colorizer

This commit is contained in:
Rokas Puzonas 2026-11-03 14:56:52 +02:00
parent 66c7ccb813
commit 3ed92b7d5a
2 changed files with 43 additions and 11 deletions

View File

@ -420,13 +420,45 @@ do
vim.keymap.set('v', '<S-j>', ':MoveBlock(1)<CR>', opts) vim.keymap.set('v', '<S-j>', ':MoveBlock(1)<CR>', opts)
vim.keymap.set('v', '<S-k>', ':MoveBlock(-1)<CR>', opts) vim.keymap.set('v', '<S-k>', ':MoveBlock(-1)<CR>', opts)
vim.pack.add { gh 'catgoose/nvim-colorizer.lua' } vim.pack.add { gh 'nvim-mini/mini.hipatterns' }
require('colorizer').setup({ require("mini.hipatterns").setup({
parsers = { highlighters = {
names = { enable = false }, hex_color = {
rgb = { enable = true }, pattern = "#%x%x%x%x?%x?%x?%x?%x?",
hsl = { enable = true } group = function(_, match)
} local hex = match:sub(2)
if #hex == 3 or #hex == 6 or #hex == 8 then
return MiniHipatterns.compute_hex_color_group(
match,
"bg"
)
end
end,
},
rgb_color = {
pattern = "rgba?%([^)]*%)",
group = function(_, match)
local r, g, b = match:match(
"rgb%(%s*(%d+)%s*,%s*(%d+)%s*,%s*(%d+)"
)
if not r then
r, g, b = match:match(
"rgba%(%s*(%d+)%s*,%s*(%d+)%s*,%s*(%d+)"
)
end
if r then
return MiniHipatterns.compute_hex_color_group(
string.format("#%02x%02x%02x", r, g, b),
"bg"
)
end
end,
},
},
}) })
vim.pack.add { gh 'stevearc/oil.nvim' } vim.pack.add { gh 'stevearc/oil.nvim' }

View File

@ -66,6 +66,10 @@
"rev": "2a6940af80375532e5e9e7c1f2fc6319a1b7a69d", "rev": "2a6940af80375532e5e9e7c1f2fc6319a1b7a69d",
"src": "https://github.com/mason-org/mason.nvim" "src": "https://github.com/mason-org/mason.nvim"
}, },
"mini.hipatterns": {
"rev": "247c0173579a29af60f25f00671a75c57090be9c",
"src": "https://github.com/nvim-mini/mini.hipatterns"
},
"mini.nvim": { "mini.nvim": {
"rev": "c5cdbadeb423ff724e27a42ab2d1c504d1d6fc5a", "rev": "c5cdbadeb423ff724e27a42ab2d1c504d1d6fc5a",
"src": "https://github.com/nvim-mini/mini.nvim" "src": "https://github.com/nvim-mini/mini.nvim"
@ -78,10 +82,6 @@
"rev": "ba2b365969d7c2c6301d48e13aeee59568765529", "rev": "ba2b365969d7c2c6301d48e13aeee59568765529",
"src": "https://github.com/kevinhwang91/nvim-bqf" "src": "https://github.com/kevinhwang91/nvim-bqf"
}, },
"nvim-colorizer.lua": {
"rev": "81e676d3203c9eb6e4c0ccf1eba1679296ef923f",
"src": "https://github.com/catgoose/nvim-colorizer.lua"
},
"nvim-dap": { "nvim-dap": {
"rev": "9e848e09a697ee95302a3ef2dd43fd6eb709e570", "rev": "9e848e09a697ee95302a3ef2dd43fd6eb709e570",
"src": "https://github.com/mfussenegger/nvim-dap" "src": "https://github.com/mfussenegger/nvim-dap"