Add Vue.js support
This commit is contained in:
@ -1,4 +1,42 @@
|
||||
require("nvchad.configs.lspconfig").defaults()
|
||||
|
||||
local servers = { "html", "cssls", "jdtls", "clangd", "clangd", "gopls" }
|
||||
vim.lsp.enable(servers)
|
||||
local lspconfig = require "lspconfig"
|
||||
local nvlsp = require "nvchad.configs.lspconfig"
|
||||
|
||||
local servers = { "html", "cssls", "jdtls", "clangd", "gopls", "eslint" }
|
||||
|
||||
for _, lsp in ipairs(servers) do
|
||||
lspconfig[lsp].setup {
|
||||
on_attach = nvlsp.on_attach,
|
||||
on_init = nvlsp.on_init,
|
||||
capabilities = nvlsp.capabilities,
|
||||
}
|
||||
end
|
||||
|
||||
lspconfig.ts_ls.setup {
|
||||
on_attach = nvlsp.on_attach,
|
||||
on_init = nvlsp.on_init,
|
||||
capabilities = nvlsp.capabilities,
|
||||
init_options = {
|
||||
plugins = {
|
||||
{
|
||||
name = "@vue/typescript-plugin",
|
||||
location = "",
|
||||
languages = { "vue" },
|
||||
},
|
||||
},
|
||||
},
|
||||
filetypes = { "typescript", "javascript", "javascriptreact", "typescriptreact", "vue" },
|
||||
}
|
||||
|
||||
lspconfig.volar.setup {
|
||||
on_attach = nvlsp.on_attach,
|
||||
on_init = nvlsp.on_init,
|
||||
capabilities = nvlsp.capabilities,
|
||||
init_options = {
|
||||
vue = {
|
||||
hybridMode = true,
|
||||
},
|
||||
},
|
||||
filetypes = { "vue" },
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
local options = {
|
||||
ensure_installed = { "lua", "luadoc", "printf", "vim", "vimdoc", "java", "go" },
|
||||
ensure_installed = { "lua", "luadoc", "printf", "vim", "vimdoc", "java", "go", "vue", "typescript", "javascript" },
|
||||
|
||||
highlight = {
|
||||
enable = true,
|
||||
|
@ -37,6 +37,18 @@ return {
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
-- your existing tools
|
||||
"vue-language-server",
|
||||
"typescript-language-server",
|
||||
"eslint-lsp",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
require "plugins.java.init",
|
||||
},
|
||||
|
Reference in New Issue
Block a user