From c7754370126c26da1b2987ccc25c6474ccf06f48 Mon Sep 17 00:00:00 2001 From: amalgame21 <93383215+amalgame21@users.noreply.github.com> Date: Mon, 26 Dec 2022 19:06:43 +0000 Subject: [PATCH] Prevent multiple language servers from being spawned Prevent multiple language servers from being spawned after every save of init.lua, which eventually leads to high RAM usage and system freeze. --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 636d86af..9e28aff8 100644 --- a/init.lua +++ b/init.lua @@ -87,7 +87,7 @@ end -- Automatically source and re-compile packer whenever you save this init.lua local packer_group = vim.api.nvim_create_augroup('Packer', { clear = true }) vim.api.nvim_create_autocmd('BufWritePost', { - command = 'source | PackerCompile', + command = 'source | LspStop | LspStart | PackerCompile', group = packer_group, pattern = vim.fn.expand '$MYVIMRC', })