From 929b1530529390935b0ea9ad888f6f78128ce222 Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Sun, 4 Aug 2024 01:01:44 +0300 Subject: refactor(nvim): moved mason to it's own file out of lspconfig --- .config/nvim/lua/custom/config/lsp.lua | 22 +---------------- .config/nvim/lua/custom/config/mason.lua | 41 -------------------------------- 2 files changed, 1 insertion(+), 62 deletions(-) delete mode 100644 .config/nvim/lua/custom/config/mason.lua (limited to '.config/nvim/lua/custom/config') diff --git a/.config/nvim/lua/custom/config/lsp.lua b/.config/nvim/lua/custom/config/lsp.lua index fcb2ff1..0c02e46 100644 --- a/.config/nvim/lua/custom/config/lsp.lua +++ b/.config/nvim/lua/custom/config/lsp.lua @@ -40,27 +40,7 @@ vim.api.nvim_create_autocmd('LspAttach', { end end - -- Register LSP keymaps local to buffer + -- Register buffer local LSP keymaps require('custom.config.lsp-keymaps').setup(bufnr) end, }) - --- TODO: Decide if you want to use conform or not --- --- -- Autoformatting Setup --- require('conform').setup({ --- formatters_by_ft = { --- lua = { 'stylua' }, --- }, --- }) --- --- vim.api.nvim_create_autocmd('BufWritePre', { --- callback = function(args) --- require('conform').format({ --- bufnr = args.buf, --- lsp_fallback = true, --- quiet = true, --- }) --- end, --- }) - diff --git a/.config/nvim/lua/custom/config/mason.lua b/.config/nvim/lua/custom/config/mason.lua deleted file mode 100644 index 9d42879..0000000 --- a/.config/nvim/lua/custom/config/mason.lua +++ /dev/null @@ -1,41 +0,0 @@ --- NOTE: Not language servers but still make sure mason installs them -local ensure_installed = { - stylua = true, -- lua formatting - jdtls = true, -- java eclipse lsp -} -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 - 'java-debug-adapter', - 'java-test', - }, -}) - --- NOTE: apparently needed due to some issue or smthing? -vim.api.nvim_command('MasonToolsInstall') - - -- cgit v1.3.1