From 9a52377e2d64130994ec6945d49ae3ff7c904854 Mon Sep 17 00:00:00 2001 From: serxoz Date: Tue, 2 Aug 2022 18:37:31 +0200 Subject: [PATCH] add python and rust to lsp --- nvim/README.md | 6 +++++- nvim/custom/chadrc.lua | 1 + nvim/custom/override.lua | 8 ++++++++ nvim/custom/plugins/lspconfig.lua | 2 +- 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/nvim/README.md b/nvim/README.md index 53eb427..57c50f2 100644 --- a/nvim/README.md +++ b/nvim/README.md @@ -6,5 +6,9 @@ In order to install nvchad pluggins and custom ones you must follow: - :q - exec nvim - :PackerSync -- :q +- :MasonInstallAll - now it must work fine + +## Add language to LSP +- Add lang server in "custom/plugins/lspconfig.lua" file. +- Add lang server to Mason custom override in "custom/override.lua" to install with ":MasonInstallAll" diff --git a/nvim/custom/chadrc.lua b/nvim/custom/chadrc.lua index 01978b9..be5f992 100644 --- a/nvim/custom/chadrc.lua +++ b/nvim/custom/chadrc.lua @@ -5,6 +5,7 @@ local override = require "custom.override" M.plugins = { override = { ["nvim-treesitter/nvim-treesitter"] = override.treesitter, + ["williamboman/mason.nvim"] = override.mason, }, user = require "custom.plugins", } diff --git a/nvim/custom/override.lua b/nvim/custom/override.lua index b74713f..9c1475f 100644 --- a/nvim/custom/override.lua +++ b/nvim/custom/override.lua @@ -17,4 +17,12 @@ M.treesitter = { }, } +M.mason = { + ensure_installed = { + "gopls", + "pyright", + "rust-analyzer", + } +} + return M diff --git a/nvim/custom/plugins/lspconfig.lua b/nvim/custom/plugins/lspconfig.lua index 4b81db4..3dd39d8 100644 --- a/nvim/custom/plugins/lspconfig.lua +++ b/nvim/custom/plugins/lspconfig.lua @@ -3,7 +3,7 @@ local on_attach = require("plugins.configs.lspconfig").on_attach local capabilities = require("plugins.configs.lspconfig").capabilities local lspconfig = require "lspconfig" -local servers = { "html", "cssls", "clangd", "gopls"} +local servers = { "html", "cssls", "clangd", "gopls", "pyright", "rust-analyzer"} for _, lsp in ipairs(servers) do lspconfig[lsp].setup {