From 565e57c0155e31235eb3d2ef0a83fe36d058530a Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Mon, 22 Jul 2024 18:18:10 +0300 Subject: feat(neovim): major lsp refactor and some more lazy loading --- .config/nvim/lua/custom/configs/mason.lua | 33 +++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .config/nvim/lua/custom/configs/mason.lua (limited to '.config/nvim/lua/custom/configs/mason.lua') diff --git a/.config/nvim/lua/custom/configs/mason.lua b/.config/nvim/lua/custom/configs/mason.lua new file mode 100644 index 0000000..d7a537b --- /dev/null +++ b/.config/nvim/lua/custom/configs/mason.lua @@ -0,0 +1,33 @@ +-- NOTE: Not language servers but still make sure mason installs them +local ensure_installed = { + stylua = true, -- lua formatting +} +local servers = require('custom.configs.language-servers') + +require('mason').setup({ + ui = { + icons = { + package_installed = '✓', + package_pending = '➜', + package_uninstalled = '✗', + }, + }, +}) + +local servers_to_install = vim.tbl_filter(function(key) + local server = servers[key] + if type(server) == 'table' then + return true + else + return server + end +end, vim.tbl_keys(servers)) + +vim.list_extend(ensure_installed, servers_to_install) +require('mason-lspconfig').setup({ ensure_installed = servers_to_install }) + +require('mason-tool-installer').setup({ + ensure_installed = { + 'stylua', -- lua formatter + }, +}) -- cgit v1.3.1