Skip to content

Instantly share code, notes, and snippets.

@zealot128
Last active April 6, 2023 13:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zealot128/cf8b0ad74df5a9ab3e734b9e6acc41e8 to your computer and use it in GitHub Desktop.
Save zealot128/cf8b0ad74df5a9ab3e734b9e6acc41e8 to your computer and use it in GitHub Desktop.
Neovim Tailwindcss with custom files (Ruby, ViewComponents, Phlex etc.)
local lspconfig = require('lspconfig')
-- https://github.com/tailwindlabs/tailwindcss-intellisense/issues/737
lspconfig.tailwindcss.setup {
--on_attach = on_attach,
--flags = lsp_flags,
filetypes = { "aspnetcorerazor", "astro", "astro-markdown", "blade", "clojure", "django-html", "htmldjango", "edge", "eelixir", "elixir", "ejs", "erb", "eruby", "gohtml", "haml", "handlebars", "hbs", "html", "html-eex", "heex", "jade", "leaf", "liquid", "markdown", "mdx", "mustache", "njk", "nunjucks", "php", "razor", "slim", "twig", "css", "less", "postcss", "sass", "scss", "stylus", "sugarss", "javascript", "javascriptreact", "reason", "rescript", "typescript", "typescriptreact", "vue", "svelte", "ruby" },
init_options = {
userLanguages = {
ruby = "php",
},
},
settings = {
tailwindCSS = {
experimental = {
classRegex = {
[[class= "([^"]*)]],
[[class: "([^"]*)]],
[[class= '([^"]*)]],
[[class: '([^"]*)]],
'~H""".*class="([^"]*)".*"""',
'~F""".*class="([^"]*)".*"""',
},
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment