replace colorizer
This commit is contained in:
parent
66c7ccb813
commit
3ed92b7d5a
46
init.lua
46
init.lua
@ -420,13 +420,45 @@ do
|
||||
vim.keymap.set('v', '<S-j>', ':MoveBlock(1)<CR>', opts)
|
||||
vim.keymap.set('v', '<S-k>', ':MoveBlock(-1)<CR>', opts)
|
||||
|
||||
vim.pack.add { gh 'catgoose/nvim-colorizer.lua' }
|
||||
require('colorizer').setup({
|
||||
parsers = {
|
||||
names = { enable = false },
|
||||
rgb = { enable = true },
|
||||
hsl = { enable = true }
|
||||
}
|
||||
vim.pack.add { gh 'nvim-mini/mini.hipatterns' }
|
||||
require("mini.hipatterns").setup({
|
||||
highlighters = {
|
||||
hex_color = {
|
||||
pattern = "#%x%x%x%x?%x?%x?%x?%x?",
|
||||
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' }
|
||||
|
||||
@ -66,6 +66,10 @@
|
||||
"rev": "2a6940af80375532e5e9e7c1f2fc6319a1b7a69d",
|
||||
"src": "https://github.com/mason-org/mason.nvim"
|
||||
},
|
||||
"mini.hipatterns": {
|
||||
"rev": "247c0173579a29af60f25f00671a75c57090be9c",
|
||||
"src": "https://github.com/nvim-mini/mini.hipatterns"
|
||||
},
|
||||
"mini.nvim": {
|
||||
"rev": "c5cdbadeb423ff724e27a42ab2d1c504d1d6fc5a",
|
||||
"src": "https://github.com/nvim-mini/mini.nvim"
|
||||
@ -78,10 +82,6 @@
|
||||
"rev": "ba2b365969d7c2c6301d48e13aeee59568765529",
|
||||
"src": "https://github.com/kevinhwang91/nvim-bqf"
|
||||
},
|
||||
"nvim-colorizer.lua": {
|
||||
"rev": "81e676d3203c9eb6e4c0ccf1eba1679296ef923f",
|
||||
"src": "https://github.com/catgoose/nvim-colorizer.lua"
|
||||
},
|
||||
"nvim-dap": {
|
||||
"rev": "9e848e09a697ee95302a3ef2dd43fd6eb709e570",
|
||||
"src": "https://github.com/mfussenegger/nvim-dap"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user