nvim-colorizer.lua 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. -- "#FF00FF"
  2. local opts = {
  3. filetypes = {
  4. "*",
  5. --"!lazy",
  6. },
  7. user_default_options = {
  8. -- Color names like RED
  9. names = true,
  10. -- #RGB Hex codes
  11. RGB = true,
  12. -- #RRGGBB Hex codes
  13. RRGGBB = true,
  14. -- #RRGGBBAA Hex
  15. RRGGBBAA = false,
  16. -- 0xAARRGGBB Hex codes
  17. AARRGGBB = false,
  18. -- CSS rgb() and rgba() functions
  19. rgb_fn = false,
  20. -- CSS hsl() and hsla() functions
  21. hsl_fn = false,
  22. -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB
  23. css = false,
  24. -- Enable all CSS *functions*: rgb_fn, hsl_fn
  25. css_fn = false,
  26. -- Available modes for `mode`: foreground, background, virtualtext
  27. mode = "background", -- Set the display mode.
  28. -- Available methods are false / true / "normal" / "lsp" / "both"
  29. -- True is same as normal
  30. tailwind = false, -- Enable tailwind colors
  31. -- parsers can contain values used in |user_default_options|
  32. sass = { enable = false, parsers = { "css" } }, -- Enable sass colors
  33. virtualtext = "■",
  34. -- update color values even if buffer is not focused
  35. -- example use: cmp_menu, cmp_docs
  36. always_update = true,
  37. },
  38. -- all the sub-options of filetypes apply to buftypes
  39. -- buftypes = {},
  40. }
  41. require("colorizer").setup(opts)
  42. -- execute colorizer as soon as possible
  43. vim.defer_fn(function()
  44. require("colorizer").attach_to_buffer(0)
  45. end, 0)