mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-12-25 12:14:19 +01:00
fix(tailwind): additional settings (#5266)
Make it possible to define your own tailwind settings in opts, and merge them with the default, additional Phoenix settings in tailwind.lua ## Description Add the possibility to add your own tailwind settings in opts and have them deep merged into the default `opts.settings` I needed this for configuring support for tailwind when coding on a [htmgo](https://htmgo.dev/docs/misc/tailwind-intellisense) project in Neovim. E.g. ```lua return { "neovim/nvim-lspconfig", opts = { servers = { tailwindcss = { filetypes_include = { "go" }, settings = { tailwindCSS = { includeLanguages = { go = "html", }, experimental = { classRegex = { { "Class\\(([^)]*)\\)", '["`]([^"`]*)["`]' }, { "ClassX\\(([^)]*)\\)", '["`]([^"`]*)["`]' }, { "ClassIf\\(([^)]*)\\)", '["`]([^"`]*)["`]' }, { "Classes\\(([^)]*)\\)", '["`]([^"`]*)["`]' }, }, }, }, }, }, }, }, } ``` ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines.
This commit is contained in:
@@ -24,6 +24,20 @@ return {
|
||||
filetypes_include = {},
|
||||
-- to fully override the default_config, change the below
|
||||
-- filetypes = {}
|
||||
|
||||
-- additional settings for the server, e.g:
|
||||
-- tailwindCSS = { includeLanguages = { someLang = "html" } }
|
||||
-- can be addeded to the settings table and will be merged with
|
||||
-- this defaults for Phoenix projects
|
||||
settings = {
|
||||
tailwindCSS = {
|
||||
includeLanguages = {
|
||||
elixir = "html-eex",
|
||||
eelixir = "html-eex",
|
||||
heex = "html-eex",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
setup = {
|
||||
@@ -39,17 +53,6 @@ return {
|
||||
return not vim.tbl_contains(opts.filetypes_exclude or {}, ft)
|
||||
end, opts.filetypes)
|
||||
|
||||
-- Additional settings for Phoenix projects
|
||||
opts.settings = {
|
||||
tailwindCSS = {
|
||||
includeLanguages = {
|
||||
elixir = "html-eex",
|
||||
eelixir = "html-eex",
|
||||
heex = "html-eex",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
-- Add additional filetypes
|
||||
vim.list_extend(opts.filetypes, opts.filetypes_include or {})
|
||||
end,
|
||||
|
||||
Reference in New Issue
Block a user