Add mason-lspconfig plugin

start lsp server automatically
This commit is contained in:
Yorick Barbanneau 2022-08-05 23:41:14 +02:00
parent 82d9f01eda
commit 0556e2f742
2 changed files with 17 additions and 3 deletions

View file

@ -1,7 +1,7 @@
-- Plugins -- Plugins
require "paq" { require "paq" {
"savq/paq-nvim"; "savq/paq-nvim";
-- status bar -- status bar
'nvim-lualine/lualine.nvim'; 'nvim-lualine/lualine.nvim';
@ -12,19 +12,21 @@ require "paq" {
'scrooloose/nerdtree'; 'scrooloose/nerdtree';
'lewis6991/gitsigns.nvim'; 'lewis6991/gitsigns.nvim';
-- need to install g++ package on Debian -- need to install g++ package on Debian
-- for tree sitter plugins -- for tree sitter plugins
'nvim-treesitter/nvim-treesitter'; 'nvim-treesitter/nvim-treesitter';
-- LSP installer -- LSP installer
'neovim/nvim-lspconfig'; 'neovim/nvim-lspconfig';
-- Mason is a GUI to install language servers and lspconfig is a bridge
-- between mason and nvim-lspconfig
'williamboman/mason.nvim'; 'williamboman/mason.nvim';
'williamboman/mason-lspconfig.nvim';
-- autocompletion plugin -- autocompletion plugin
'hrsh7th/nvim-cmp'; 'hrsh7th/nvim-cmp';
'hrsh7th/cmp-nvim-lsp'; 'hrsh7th/cmp-nvim-lsp';
-- vim lint when it is not possible withlsp -- vim lint when it is not possible withlsp
'mfussenegger/nvim-lint'; 'mfussenegger/nvim-lint';
} }

View file

@ -1 +1,13 @@
local mason = require("mason").setup() local mason = require("mason").setup()
local mason_lspconfig = require("mason-lspconfig").setup()
require("mason-lspconfig").setup_handlers({
-- The first entry (without a key) will be the default handler
-- and will be called for each installed server that doesn't have
-- a dedicated handler.
function (server_name) -- default handler (optional)
require("lspconfig")[server_name].setup {}
end,
-- Next, you can provide targeted overrides for specific servers.
--
})