Skip to content

Instantly share code, notes, and snippets.

@wladston
Created September 11, 2025 20:44
Show Gist options
  • Select an option

  • Save wladston/6004d1201ffa28b45341b44cdbdefc10 to your computer and use it in GitHub Desktop.

Select an option

Save wladston/6004d1201ffa28b45341b44cdbdefc10 to your computer and use it in GitHub Desktop.
Minimal Neovim + Lazy + Mason setup: Enable LSP in Vue
return {
{ 'neovim/nvim-lspconfig' },
{ 'mason-org/mason.nvim', opts = {} },
{
'mason-org/mason-lspconfig.nvim',
opts = {
ensure_installed = { 'ts_ls', 'vue_ls' },
},
config = function(_, opts)
require('mason-lspconfig').setup(opts)
local vue_ls_path = vim.fn.expand '$MASON/packages'
.. '/vue-language-server'
.. '/node_modules/@vue/language-server'
vim.lsp.config('ts_ls', {
init_options = {
plugins = {
{
name = "@vue/typescript-plugin",
location = vue_ls_path,
languages = { "vue" },
}
}
},
filetypes = {
'javascript', 'javascriptreact',
'typescript', 'typescriptreact',
'vue',
},
})
end,
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment