mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-22 12:31:07 +00: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:
parent
9d345dec44
commit
d2f9885d6b
1 changed files with 14 additions and 11 deletions
|
|
@ -24,6 +24,20 @@ return {
|
||||||
filetypes_include = {},
|
filetypes_include = {},
|
||||||
-- to fully override the default_config, change the below
|
-- to fully override the default_config, change the below
|
||||||
-- filetypes = {}
|
-- 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 = {
|
setup = {
|
||||||
|
|
@ -39,17 +53,6 @@ return {
|
||||||
return not vim.tbl_contains(opts.filetypes_exclude or {}, ft)
|
return not vim.tbl_contains(opts.filetypes_exclude or {}, ft)
|
||||||
end, opts.filetypes)
|
end, opts.filetypes)
|
||||||
|
|
||||||
-- Additional settings for Phoenix projects
|
|
||||||
opts.settings = {
|
|
||||||
tailwindCSS = {
|
|
||||||
includeLanguages = {
|
|
||||||
elixir = "html-eex",
|
|
||||||
eelixir = "html-eex",
|
|
||||||
heex = "html-eex",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Add additional filetypes
|
-- Add additional filetypes
|
||||||
vim.list_extend(opts.filetypes, opts.filetypes_include or {})
|
vim.list_extend(opts.filetypes, opts.filetypes_include or {})
|
||||||
end,
|
end,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue