tailwind-highlight.nvim
Highlight Tailwind CSS classes in neovim
"The neovim plugin used by a Netflix Engineer"
Installation
-
" required dependency Plug 'neovim/nvim-lspconfig' " (optional) for installing tailwindcss language server Plug 'williamboman/nvim-lsp-installer' Plug 'princejoogie/tailwind-highlight.nvim'
-
" required dependency Plugin 'neovim/nvim-lspconfig' " (optional) for installing tailwindcss language server Plugin 'williamboman/nvim-lsp-installer' Plugin 'princejoogie/tailwind-highlight.nvim'
-
" required dependency call dein#add('neovim/nvim-lspconfig') " (optional) for installing tailwindcss language server call dein#add('williamboman/nvim-lsp-installer') call dein#add('princejoogie/tailwind-highlight.nvim')
Usage
local tw_highlight = require('tailwind-highlight')
Methods
Method | Args | Returns |
---|---|---|
setup |
(client, bufnr, opts) |
void |
ping |
N/A |
string |
Setup Options
Option | Description | Default |
---|---|---|
single_column |
highlight only first character | false |
mode |
highlight mode foreground | background |
background |
debounce |
delay on updating highlights (ms) | 200 |
Without Lsp Installer
Manually install tailwindcss-language-server
require('lspconfig').tailwindcss.setup({
on_attach = function(client, bufnr)
-- rest of you config
tw_highlight.setup(client, bufnr, {
single_column = false,
mode = 'background',
debounce = 200,
})
end
})
With Lsp Installer
:LspInstall tailwindcss
require('nvim-lsp-installer').on_server_ready(function(server)
local opts = {
on_attach = function(client, bufnr)
-- rest of you config
tw_highlight.setup(client, bufnr, {
single_column = false,
mode = 'background',
debounce = 200,
})
end
}
server:setup(opts)
end)
Like the project? would appreciate a coffee
Contributor list
Made with
Display color chip as virtual text?
Thanks for this plugin!
I'm wondering if it would be possible to provide an option to display the color as a chip next to the class name as virtual text? For example, this is what another nvim plugin (rrethy/vim-hexokinase) does for hex codes: