From 081b578a22a5932bfb6e10176dc91ab66e65980e Mon Sep 17 00:00:00 2001 From: Lucas Barbieri Date: Thu, 18 Apr 2024 16:41:31 -0300 Subject: [PATCH] add hybrid mode for vue --- init.lua | 22 +++++++++++++++++++--- lua/custom/plugins/nvim-ts-pairs.lua | 6 ++++++ 2 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 lua/custom/plugins/nvim-ts-pairs.lua diff --git a/init.lua b/init.lua index 3437091..b2c9cdb 100644 --- a/init.lua +++ b/init.lua @@ -345,7 +345,6 @@ local on_attach = function(_, bufnr) ) vim.diagnostic.config({ float = { border = "single" } }) end - local servers = { -- clangd = {}, -- hls = {}, @@ -358,7 +357,7 @@ local servers = { html = { provideFormatter = false }, cssls = {}, pyright = {}, - tsserver = {}, + vtsls = {}, jdtls = { java = { @@ -409,10 +408,27 @@ mason_lspconfig.setup_handlers { local lspconfig = require("lspconfig") +local mason_registry = require('mason-registry') +local vue_language_server_path = mason_registry.get_package('vue-language-server'):get_install_path() .. + '/node_modules/@vue/language-server' + +lspconfig.tsserver.setup { + init_options = { + plugins = { + { + name = '@vue/typescript-plugin', + location = vue_language_server_path, + languages = { 'vue' }, + }, + }, + }, + filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue' }, +} + lspconfig.volar.setup { init_options = { vue = { - hybridMode = false, + hybridMode = true, }, }, } diff --git a/lua/custom/plugins/nvim-ts-pairs.lua b/lua/custom/plugins/nvim-ts-pairs.lua new file mode 100644 index 0000000..4cbeffc --- /dev/null +++ b/lua/custom/plugins/nvim-ts-pairs.lua @@ -0,0 +1,6 @@ +return { + "yorickpeterse/nvim-tree-pairs", + config = function() + require('tree-pairs').setup() + end +}