summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/custom/config/mason.lua
diff options
context:
space:
mode:
authorKyren223 <ulmliad223@gmail.com>2024-07-23 19:53:55 +0300
committerKyren223 <ulmliad223@gmail.com>2024-07-23 19:53:55 +0300
commitf7e480cd62e58e913bfb0a93f36f4dca026352e5 (patch)
tree1dd98d7911acf2f2222d23cd267e22e41f1e12f8 /.config/nvim/lua/custom/config/mason.lua
parent09623783f8b2c5bf6fa3aa490f973d36080df907 (diff)
refactor(neovim): renamed custom/configs -> custom/config
Diffstat (limited to '.config/nvim/lua/custom/config/mason.lua')
-rw-r--r--.config/nvim/lua/custom/config/mason.lua33
1 files changed, 33 insertions, 0 deletions
diff --git a/.config/nvim/lua/custom/config/mason.lua b/.config/nvim/lua/custom/config/mason.lua
new file mode 100644
index 0000000..886adc2
--- /dev/null
+++ b/.config/nvim/lua/custom/config/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.config.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
+ },
+})