From 262babb6db5bd2cc6c86264b2a6f7ced5b9b53f3 Mon Sep 17 00:00:00 2001 From: chuyanlong Date: Fri, 8 Aug 2025 13:48:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0html-css?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/lazyvim/plugins/extras/lang/html-css.lua | 92 ++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 lua/lazyvim/plugins/extras/lang/html-css.lua diff --git a/lua/lazyvim/plugins/extras/lang/html-css.lua b/lua/lazyvim/plugins/extras/lang/html-css.lua new file mode 100644 index 00000000..9931b149 --- /dev/null +++ b/lua/lazyvim/plugins/extras/lang/html-css.lua @@ -0,0 +1,92 @@ +local list_insert_unique = require("utils").list_insert_unique +local filetypes = { + "css", + "eruby", + "html", + "htmldjango", + "javascriptreact", + "less", + "pug", + "sass", + "scss", + "typescriptreact", + "vue", +} + +return { + { + "neovim/nvim-lspconfig", + opts = function(_, opts) + vim.tbl_deep_extend("force", opts.servers, { + emmet_language_server = { + init_options = { + --- @type boolean Defaults to `true` + showAbbreviationSuggestions = false, + --- @type "always" | "never" Defaults to `"always"` + showExpandedAbbreviation = "always", + --- @type boolean Defaults to `false` + showSuggestionsAsSnippets = true, + }, + filetypes, + }, + html = { init_options = { provideFormatter = false } }, + cssls = { + init_options = { provideFormatter = false }, + settings = { + css = { + lint = { + unknownAtRules = "ignore", + }, + }, + less = { + lint = { + unknownAtRules = "ignore", + }, + }, + scss = { + validate = false, + lint = { + unknownAtRules = "ignore", + }, + }, + }, + }, + }) + end, + }, + { + "nvim-treesitter/nvim-treesitter", + opts = function(_, opts) + if opts.ensure_installed ~= "all" then + list_insert_unique(opts.ensure_installed, { + "html", + "css", + "scss", + }) + end + vim.treesitter.language.register("scss", "less") + vim.treesitter.language.register("scss", "postcss") + end, + }, + { + "mason-org/mason.nvim", + opts = function(_, opts) + opts.ensure_installed = opts.ensure_installed or {} + list_insert_unique(opts.ensure_installed, { + "html-lsp", + "cssmodules-language-server", + "css-lsp", + "emmet-language-server", + }) + end, + }, + { + "echasnovski/mini.icons", + optional = true, + opts = { + filetype = { + postcss = { glyph = "󰌜", hl = "MiniIconsOrange" }, + }, + }, + }, +}