From 39a18835a12c70964bec549412374f51d98b567b Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Wed, 15 Nov 2023 06:14:35 +0100 Subject: [PATCH] Feat(nvim): add mason_tool_installer --- nvim/.config/nvim/lua/plugins/lsp.lua | 57 ++++++++++++++++----------- 1 file changed, 35 insertions(+), 22 deletions(-) diff --git a/nvim/.config/nvim/lua/plugins/lsp.lua b/nvim/.config/nvim/lua/plugins/lsp.lua index dbbdf37..426fd39 100644 --- a/nvim/.config/nvim/lua/plugins/lsp.lua +++ b/nvim/.config/nvim/lua/plugins/lsp.lua @@ -1,25 +1,38 @@ return { - 'VonHeikemen/lsp-zero.nvim', - branch = 'v3.x', - dependencies = { - {'neovim/nvim-lspconfig'}, - {'williamboman/mason.nvim'}, - {'williamboman/mason-lspconfig.nvim'}, - }, - config = function () - local lsp_zero = require('lsp-zero') - lsp_zero.on_attach(function(client, bufnr) - -- see :help lsp-zero-keybindings - -- to learn the available actions - lsp_zero.default_keymaps({buffer = bufnr}) - end) + "VonHeikemen/lsp-zero.nvim", + branch = "v3.x", + dependencies = { + { "neovim/nvim-lspconfig" }, + { "williamboman/mason.nvim" }, + { "williamboman/mason-lspconfig.nvim" }, + { "WhoIsSethDaniel/mason-tool-installer.nvim" }, + }, + config = function() + local lsp_zero = require("lsp-zero") + lsp_zero.on_attach(function(client, bufnr) + -- see :help lsp-zero-keybindings + -- to learn the available actions + lsp_zero.default_keymaps({ buffer = bufnr }) + end) - require('mason').setup({}) - require('mason-lspconfig').setup({ - ensure_installed = {}, - handlers = { - lsp_zero.default_setup, - }, - }) - end + require("mason").setup({}) + require("mason-lspconfig").setup({ + ensure_installed = {}, + handlers = { + lsp_zero.default_setup, + }, + }) + local mason_tool_installer = require("mason-tool-installer") + + mason_tool_installer.setup({ + ensure_installed = { + "prettier", -- prettier formatter + "stylua", -- lua formatter + "isort", -- python formatter + "black", -- python formatter + "flake8", -- python linter + "eslint_d", -- js linter + }, + }) + end, }