aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoramalgame21 <93383215+amalgame21@users.noreply.github.com>2022-12-28 06:33:44 +0000
committerGitHub <noreply@github.com>2022-12-28 01:33:44 -0500
commitc4d7212de3d309a20435333f42a0473cee81e29a (patch)
tree585b335846e56247f4a4f92a0ada523112882d19
parent39a941c3851fbadf08731601b9958785e50bee73 (diff)
Prevent multiple language servers from being spawned after every file save of init.lua (#96)
* 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. * Supress error messages add `silent!` in case of error message when nvim-lspconfig is not installed
-rw-r--r--init.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/init.lua b/init.lua
index 636d86a..c8f18d5 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 <afile> | PackerCompile',
+ command = 'source <afile> | silent! LspStop | silent! LspStart | PackerCompile',
group = packer_group,
pattern = vim.fn.expand '$MYVIMRC',
})