feat: colorizer improved

This commit is contained in:
2026-07-11 10:32:32 +02:00
parent 06e6665f52
commit e1429b3224
3 changed files with 104 additions and 22 deletions

57
lua/plugins/edit.lua Normal file
View File

@@ -0,0 +1,57 @@
return {
{
"brenton-leighton/multiple-cursors.nvim",
version = "*", -- Use the latest tagged version
opts = {}, -- This causes the plugin setup function to be called
keys = {
{ "<C-j>", "<Cmd>MultipleCursorsAddDown<CR>", mode = { "n", "x" }, desc = "Add cursor and move down" },
{ "<C-k>", "<Cmd>MultipleCursorsAddUp<CR>", mode = { "n", "x" }, desc = "Add cursor and move up" },
{ "<C-Up>", "<Cmd>MultipleCursorsAddUp<CR>", mode = { "n", "i", "x" }, desc = "Add cursor and move up" },
{
"<C-Down>",
"<Cmd>MultipleCursorsAddDown<CR>",
mode = { "n", "i", "x" },
desc = "Add cursor and move down",
},
{
"<C-LeftMouse>",
"<Cmd>MultipleCursorsMouseAddDelete<CR>",
mode = { "n", "i" },
desc = "Add or remove cursor on mouse click",
},
{
"<C-Return>",
"<Cmd>MultipleCursorsAddDelete<CR>",
mode = { "n" },
desc = "Add a locked cursor or remove an existing cursor",
},
{
"<Leader>m",
"<Cmd>MultipleCursorsAddVisualArea<CR>",
mode = { "x" },
desc = "Add cursors to the lines of the visual area",
},
{ "<Leader>a", "<Cmd>MultipleCursorsAddMatches<CR>", mode = { "n", "x" }, desc = "Add cursors to cword" },
{
"<Leader>A",
"<Cmd>MultipleCursorsAddMatchesV<CR>",
mode = { "n", "x" },
desc = "Add cursors to cword in previous area",
},
{
"<Leader>d",
"<Cmd>MultipleCursorsAddJumpNextMatch<CR>",
mode = { "n", "x" },
desc = "Add cursor and jump to next cword",
},
{ "<Leader>D", "<Cmd>MultipleCursorsJumpNextMatch<CR>", mode = { "n", "x" }, desc = "Jump to next cword" },
{ "<Leader>l", "<Cmd>MultipleCursorsLock<CR>", mode = { "n", "x" }, desc = "Lock virtual cursors" },
},
},
}

View File

@@ -1,8 +1,34 @@
return {
{
"norcalli/nvim-colorizer.lua",
init = function(_, opts)
return require("colorizer").setup(opts)
"NvChad/nvim-colorizer.lua",
config = function()
require("colorizer").setup({
filetypes = { "css", "javascript", html = { mode = "foreground" }, "astro", "vue", "scss" },
user_default_options = {
RGB = true, -- #RGB hex codes
RRGGBB = true, -- #RRGGBB hex codes
names = true, -- "Name" codes like Blue or blue
RRGGBBAA = true, -- #RRGGBBAA hex codes
AARRGGBB = false, -- 0xAARRGGBB 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
-- Available modes for `mode`: foreground, background, virtualtext
mode = "virtualtext", -- Set the display mode.
-- Available methods are false / true / "normal" / "lsp" / "both"
-- True is same as normal
tailwind = false, -- Enable tailwind colors
-- parsers can contain values used in |user_default_options|
sass = { enable = true, parsers = { "css" } }, -- Enable sass colors
virtualtext = "",
-- update color values even if buffer is not focused
-- example use: cmp_menu, cmp_docs
always_update = false,
},
-- all the sub-options of filetypes apply to buftypes
buftypes = {},
})
end,
},
}