Highlight Tailwind CSS classes in neovim
"The neovim plugin used by a Netflix Engineer (@trash_dev)"
-
-- required dependency use "neovim/nvim-lspconfig" -- (optional) for installing tailwindcss language server use "williamboman/nvim-lsp-installer" use "princejoogie/tailwind-highlight.nvim"
-
" required dependency Plug 'neovim/nvim-lspconfig' " (optional) for installing tailwindcss language server Plug 'williamboman/nvim-lsp-installer' Plug 'princejoogie/tailwind-highlight.nvim'
local tw_highlight = require('tailwind-highlight')
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
})
: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)
Method | Args | Returns |
---|---|---|
setup |
(client, bufnr, opts) |
void |
ping |
N/A |
string |
Option | Description | Default |
---|---|---|
single_column |
highlight only first character | false |
mode |
highlight mode foreground | background |
background |
debounce |
delay on updating highlights (ms) | 200 |
Like the project? would appreciate a coffee ☕
Made with ☕ by Prince Carlo Juguilon