diff --git a/lua/dot013/plugins/lsp.lua b/lua/dot013/plugins/lsp.lua index adb65c1..33d818b 100644 --- a/lua/dot013/plugins/lsp.lua +++ b/lua/dot013/plugins/lsp.lua @@ -1,5 +1,40 @@ local lsps = { ["cssls"] = nil, + ["emmet_language_server"] = { + filetypes = { + "css", + "eruby", + "html", + "javascript", + "javascriptreact", + "less", + "sass", + "scss", + "pug", + "templ", + "typescriptreact", + }, + init_options = { + ---@type table + includeLanguages = {}, + --- @type string[] + excludeLanguages = {}, + --- @type string[] + extensionsPath = {}, + --- @type table [Emmet Docs](https://docs.emmet.io/customization/preferences/) + preferences = {}, + --- @type boolean Defaults to `true` + showAbbreviationSuggestions = true, + --- @type "always" | "never" Defaults to `"always"` + showExpandedAbbreviation = "always", + --- @type boolean Defaults to `false` + showSuggestionsAsSnippets = false, + --- @type table [Emmet Docs](https://docs.emmet.io/customization/syntax-profiles/) + syntaxProfiles = {}, + --- @type table [Emmet Docs](https://docs.emmet.io/customization/snippets/#variables) + variables = {}, + }, + }, ["eslint"] = nil, ["denols"] = nil, ["lua_ls"] = { @@ -53,4 +88,18 @@ return { end end, }, + + -- Emmet integration + { + "nvim-emmet", + ft = lsps["emmet_language_server"].filetypes, + keys = { + { + "we", + ":lua require('nvim-emmet').wrap_with_abbreviation()", + desc = "[Emmet] Wrap with emmet abbreviation", + mode = { "n", "v" }, + }, + }, + }, } diff --git a/neovim.nix b/neovim.nix index fc4ac08..1924d41 100644 --- a/neovim.nix +++ b/neovim.nix @@ -9,6 +9,7 @@ startPlugins = with pkgs; with vimPlugins; [ + blink-cmp catppuccin-nvim indent-blankline-nvim lze @@ -27,7 +28,6 @@ with pkgs.vimPlugins; [ auto-save-nvim auto-session - blink-cmp cloak-nvim conform-nvim comment-nvim @@ -45,9 +45,19 @@ telescope-nvim telescope-fzf-native-nvim tmux-nvim + + (vimUtils.buildVimPlugin { + pname = "nvim-emmet"; + version = "v0.4.4"; + src = fetchGit { + url = "https://github.com/olrtg/nvim-emmet"; + rev = "cde4fb2968704aae5c18b7f8a9bc2508767bb78d"; + }; + }) ]; languageServers = with pkgs; [ + emmet-language-server deno gopls htmx-lsp