From f9774a6a5a550048a311ecdec664fe8e824beaca Mon Sep 17 00:00:00 2001 From: Zackarias Montell Date: Thu, 1 May 2025 11:16:20 +0200 Subject: [PATCH] vue support --- .config/nvim/lazy-lock.json | 2 + .config/nvim/lazyvim.json | 7 +- .config/nvim/lua/plugins/mason.lua | 33 ++++++++ .config/nvim/lua/plugins/wholteza.lua | 112 +++++++++++++++++--------- 4 files changed, 114 insertions(+), 40 deletions(-) create mode 100644 .config/nvim/lua/plugins/mason.lua diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 845bf9b..bc0d097 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -13,6 +13,7 @@ "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, "lualine.nvim": { "branch": "master", "commit": "15884cee63a8c205334ab13ab1c891cd4d27101a" }, + "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" }, "mason-tool-installer.nvim": { "branch": "main", "commit": "1255518cb067e038a4755f5cb3e980f79b6ab89c" }, "mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" }, @@ -37,6 +38,7 @@ "nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" }, "persistence.nvim": { "branch": "main", "commit": "166a79a55bfa7a4db3e26fc031b4d92af71d0b51" }, "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, + "render-markdown.nvim": { "branch": "main", "commit": "8c33733b9af902250731539b2fe3920c76993765" }, "snacks.nvim": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" }, "telescope.nvim": { "branch": "master", "commit": "a4ed82509cecc56df1c7138920a1aeaf246c0ac5" }, "todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" }, diff --git a/.config/nvim/lazyvim.json b/.config/nvim/lazyvim.json index 6206f7e..1ce5862 100644 --- a/.config/nvim/lazyvim.json +++ b/.config/nvim/lazyvim.json @@ -1,6 +1,11 @@ { "extras": [ - + "lazyvim.plugins.extras.lang.git", + "lazyvim.plugins.extras.lang.markdown", + "lazyvim.plugins.extras.lang.toml", + "lazyvim.plugins.extras.lang.vue", + "lazyvim.plugins.extras.lang.yaml", + "lazyvim.plugins.extras.util.gitui" ], "install_version": 8, "news": { diff --git a/.config/nvim/lua/plugins/mason.lua b/.config/nvim/lua/plugins/mason.lua new file mode 100644 index 0000000..21e92ee --- /dev/null +++ b/.config/nvim/lua/plugins/mason.lua @@ -0,0 +1,33 @@ +return { + { + "WhoIsSethDaniel/mason-tool-installer.nvim", + opts = { + ensure_installed = { + "black", + "debugpy", + "flake8", + "isort", + "mypy", + "pylint", + "typescript-language-server", + "vue-language-server", + "eslint-lsp", + }, + }, + }, + { + "williamboman/mason.nvim", + opts = { + ensure_installed = { + "stylua", + "shellcheck", + "shfmt", + "flake8", + "pyright", + "typescript-language-server", + "vue-language-server", + "eslint-lsp", + }, + }, + }, +} diff --git a/.config/nvim/lua/plugins/wholteza.lua b/.config/nvim/lua/plugins/wholteza.lua index 0ad74d7..846d6cc 100644 --- a/.config/nvim/lua/plugins/wholteza.lua +++ b/.config/nvim/lua/plugins/wholteza.lua @@ -1,5 +1,35 @@ return { { 'echasnovski/mini.nvim', version = '*' }, + -- Testing out a nuxt setup + --{ + -- 'catgoose/vue-goto-definition.nvim', + -- event = "BufReadPre", + -- opts = { + -- filters = { + -- auto_imports = true, + -- auto_components = true, + -- import_same_file = true, + -- declaration = true, + -- duplicate_filename = true, + -- }, + -- filetypes = { "vue", "typescript" }, + -- detection = { + -- nuxt = function() + -- return vim.fn.glob(".nuxt/") ~= "" + -- end, + -- vue3 = function() + -- return vim.fn.filereadable("vite.config.ts") == 1 or vim.fn.filereadable("src/App.vue") == 1 + -- end, + -- priority = { "nuxt", "vue3" }, + -- }, + -- lsp = { + -- override_definition = true, -- override vim.lsp.buf.definition + -- }, + -- debounce = 200 + -- } + --}, + -- { "rushjs1/nuxt-goto.nvim", ft = "vue" }, + -- end of nuxt setup { "https://codeberg.org/esensar/nvim-dev-container", dependencies = "nvim-treesitter/nvim-treesitter", @@ -66,17 +96,49 @@ return { }, -- add pyright to lspconfig - --{ - -- "neovim/nvim-lspconfig", - -- ---@class PluginLspOpts - -- opts = { - -- ---@type lspconfig.options - -- servers = { - -- pyright = {}, - -- eslint = {}, - -- }, - -- }, - --}, + { + "neovim/nvim-lspconfig", + ---@class PluginLspOpts + opts = { + servers = { + pyright = {}, + eslint = {}, + volar = {}, + tsserver = { + enabled = true, + opts = { + init_options = { + plugins = { + { + name = '@vue/typescript-plugin', + location = vim.fn.stdpath 'data' .. + '/mason/packages/vue-language-server/node_modules/@vue/language-server', + languages = { 'vue' }, + }, + }, + }, + filetypes = { "typescript", "javascript", "javascriptreact", "typescriptreact", "vue" } + }, + }, + ts_ls = { + enabled = true, + opts = { + init_options = { + plugins = { + { + name = '@vue/typescript-plugin', + location = vim.fn.stdpath 'data' .. + '/mason/packages/vue-language-server/node_modules/@vue/language-server', + languages = { 'vue' }, + }, + }, + }, + filetypes = { "typescript", "javascript", "javascriptreact", "typescriptreact", "vue" } + }, + }, + }, + }, + }, -- add more treesitter parsers { @@ -141,34 +203,6 @@ return { -- add any tools you want to have installed below - -- Install mason installer - { - "WhoIsSethDaniel/mason-tool-installer.nvim", - opts = { - ensure_installed = { - "black", - "debugpy", - "flake8", - "isort", - "mypy", - "pylint", - }, - }, - }, - -- Install mason itself - { - "williamboman/mason.nvim", - opts = { - ensure_installed = { - "stylua", - "shellcheck", - "shfmt", - "flake8", - "pyright", - "typescript-language-server" - }, - }, - }, -- Install tools for python testing { "nvim-neotest/neotest-python",