mirror of
https://github.com/sadan4/nvim.git
synced 2024-11-16 22:34:39 -05:00
add mason autodownloader
This commit is contained in:
parent
c8c07c75fd
commit
4af9d8ed01
2 changed files with 19 additions and 0 deletions
17
lua/masonDownload.lua
Normal file
17
lua/masonDownload.lua
Normal file
|
@ -0,0 +1,17 @@
|
|||
local pkgs = {
|
||||
"nixpkgs-fmt",
|
||||
"jdtls",
|
||||
"yaml-language-server",
|
||||
"eslint_d",
|
||||
}
|
||||
local reg = require("mason-registry")
|
||||
for _, pname in ipairs(pkgs) do
|
||||
local pkg = reg.get_package(pname)
|
||||
if not pkg:is_installed() then
|
||||
print(string.format("[masonDownload.lua]: %s is not installed. Installing.", pname))
|
||||
local handle = pkg:install(nil)
|
||||
--while handle.state ~= "CLOSED" do
|
||||
-- print(handle.stdout)
|
||||
-- end
|
||||
end
|
||||
end
|
|
@ -4,6 +4,8 @@ vim.cmd([[colorscheme tokyonight]])
|
|||
require("mason").setup()
|
||||
require("mason-lspconfig").setup()
|
||||
|
||||
require("masonDownload")
|
||||
|
||||
require("setuplsp")
|
||||
|
||||
require("setupformat")
|
||||
|
|
Loading…
Reference in a new issue