roobert/tailwindcss-colorizer-cmp.nvim

github github
programming-languages-supportweb-development
stars 295
issues 8
subscribers 5
forks 4
CREATED

2023-01-13

UPDATED

last month


:rainbow: TailwindCSS Colorizer CMP

tailwindcss-colorizer-cmp Screenshot

A Neovim plugin to add vs-code-style TailwindCSS color hints to the nvim-cmp completion menu.

:rocket: Installation

Packer.nvim

use({
  "roobert/tailwindcss-colorizer-cmp.nvim",
  -- optionally, override the default options:
  config = function()
    require("tailwindcss-colorizer-cmp").setup({
      color_square_width = 2,
    })
  end
})

Lazy.nvim

{
  "roobert/tailwindcss-colorizer-cmp.nvim",
  -- optionally, override the default options:
  config = function()
    require("tailwindcss-colorizer-cmp").setup({
      color_square_width = 2,
    })
  end
}

:hammer_and_wrench: Usage

After installing the plugin, please ensure it's initialised with one of the following:

Standard Neovim

require("cmp").config.formatting = {
  format = require("tailwindcss-colorizer-cmp").formatter
}

LunarVim

lvim.builtin.cmp.formatting = {
  format = require("tailwindcss-colorizer-cmp").formatter
}

:heart: Related

If you'd also like color highlighting in the buffer, please see: NvChad/nvim-colorizer.lua

A nice video on adding various tailwind support to Neovim can be found here.