mirror of
https://github.com/DefectingCat/nvim
synced 2025-07-15 16:51:33 +00:00
add headless mason install all
This commit is contained in:
@ -22,8 +22,6 @@
|
||||
"lspkind.nvim": { "branch": "master", "commit": "59c3f419af48a2ffb2320cea85e44e5a95f71664" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "b431d228b7bbcdaea818bdc3e25b8cdbe861f056" },
|
||||
"markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "7446f47b3dfb7df801f31a6f6783c2ad119a6935" },
|
||||
"mason-tool-installer.nvim": { "branch": "main", "commit": "c5e07b8ff54187716334d585db34282e46fa2932" },
|
||||
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
|
||||
"mini.indentscope": { "branch": "main", "commit": "da9af64649e114aa79480c238fd23f6524bc0903" },
|
||||
"neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" },
|
||||
|
@ -29,3 +29,47 @@ user_command("FormatToggle", function()
|
||||
end, {
|
||||
desc = "Re-enable autoformat-on-save",
|
||||
})
|
||||
|
||||
-- mason install command
|
||||
-- create install all command
|
||||
local ensure_installed = {
|
||||
"gopls",
|
||||
"lua-language-server",
|
||||
"rust-analyzer",
|
||||
"html-lsp",
|
||||
"vue-language-server", -- vue
|
||||
"vtsls", -- typescript
|
||||
"tailwindcss-language-server",
|
||||
"eslint-lsp",
|
||||
"css-lsp",
|
||||
"cssmodules-language-server",
|
||||
"json-lsp",
|
||||
"yaml-language-server",
|
||||
"docker-compose-language-service",
|
||||
"dockerfile-language-server",
|
||||
"bash-language-server",
|
||||
"clangd",
|
||||
"lemminx", -- xml svg
|
||||
"deno",
|
||||
-- tools
|
||||
"prettier", -- prettier formatter
|
||||
"stylua", -- lua formatter
|
||||
"isort", -- python formatter
|
||||
-- "black", -- python formatter
|
||||
"pylint",
|
||||
"shfmt",
|
||||
"goimports",
|
||||
"gofumpt",
|
||||
"golines",
|
||||
"gomodifytags",
|
||||
"impl", -- go
|
||||
"clang-format",
|
||||
"taplo", -- toml
|
||||
"delve", -- golang debug adapter
|
||||
}
|
||||
-- Create user command to synchronously install all Mason tools in `opts.ensure_installed`.
|
||||
user_command("MasonInstallAll", function()
|
||||
for _, tool in ipairs(ensure_installed) do
|
||||
vim.cmd("MasonInstall " .. tool)
|
||||
end
|
||||
end, {})
|
||||
|
@ -1,14 +1,16 @@
|
||||
return {
|
||||
"williamboman/mason.nvim",
|
||||
-- dependencies = {
|
||||
-- "williamboman/mason-lspconfig.nvim",
|
||||
-- "WhoIsSethDaniel/mason-tool-installer.nvim",
|
||||
-- },
|
||||
event = "VeryLazy",
|
||||
-- event = "VeryLazy",
|
||||
cmd = {
|
||||
"Mason",
|
||||
"MasonUpdate",
|
||||
"MasonInstall",
|
||||
"MasonUninstall",
|
||||
"MasonUninstallAll",
|
||||
"MasonLog",
|
||||
},
|
||||
config = function()
|
||||
local mason = require("mason")
|
||||
-- local mason_lspconfig = require("mason-lspconfig")
|
||||
-- local mason_tool_installer = require("mason-tool-installer")
|
||||
|
||||
-- enable mason and configure icons
|
||||
mason.setup({
|
||||
@ -20,48 +22,5 @@ return {
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- create install all command
|
||||
local ensure_installed = {
|
||||
"gopls",
|
||||
"lua-language-server",
|
||||
"rust-analyzer",
|
||||
"html-lsp",
|
||||
"vue-language-server", -- vue
|
||||
"vtsls", -- typescript
|
||||
"tailwindcss-language-server",
|
||||
"eslint-lsp",
|
||||
"css-lsp",
|
||||
"cssmodules-language-server",
|
||||
"json-lsp",
|
||||
"yaml-language-server",
|
||||
"docker-compose-language-service",
|
||||
"dockerfile-language-server",
|
||||
"bash-language-server",
|
||||
"clangd",
|
||||
"lemminx", -- xml svg
|
||||
"deno",
|
||||
-- tools
|
||||
"prettier", -- prettier formatter
|
||||
"stylua", -- lua formatter
|
||||
"isort", -- python formatter
|
||||
-- "black", -- python formatter
|
||||
"pylint",
|
||||
"shfmt",
|
||||
"goimports",
|
||||
"gofumpt",
|
||||
"golines",
|
||||
"gomodifytags",
|
||||
"impl", -- go
|
||||
"clang-format",
|
||||
"taplo", -- toml
|
||||
"delve", -- golang debug adapter
|
||||
}
|
||||
-- Create user command to synchronously install all Mason tools in `opts.ensure_installed`.
|
||||
vim.api.nvim_create_user_command("MasonInstallAll", function()
|
||||
for _, tool in ipairs(ensure_installed) do
|
||||
vim.cmd("MasonInstall " .. tool)
|
||||
end
|
||||
end, {})
|
||||
end,
|
||||
}
|
||||
|
Reference in New Issue
Block a user