Nvim plugin for nvim-lspconfig: stop idle servers & restart upon focus; keep your RAM usage low
Some LSP servers are terribly inefficient at memory management and can easily take up gigabytes of RAM MBs if left unattended (just like VS Code huh?!). This plugin prevents excessive memory usage by stopping and restarting LSP servers automatically keeping neovim fast.
- Stop & start LSP servers upon demand
- Lower RAM usage by unsed Neovim system window
-- $HOME/.config/nvim/lua/user/init.lua
packer.setup(function(use)
use({
"hinell/lsp-timeout.nvim",
requires={ "neovim/nvim-lspconfig" },
setup = function()
vim.g["lsp-timeout-config"] = {
-- ...
}
end
})
end)
require("lazy").setup(
{
"hinell/lsp-timeout.nvim",
dependencies={ "neovim/nvim-lspconfig" }
}
)
Plug "hinell/lsp-timeout.nvim"
See DOCUMENTATION
There might some limitations however with LSP servers which don't keep cache
on hdd. Some plugins that require active LSP servers like those used for signs
may fail. Please, fill the issue for the respective plugin so they check against
vim.lsp.get_clients(...)
.
NO GUARANTEES UNTIL PAID. This project is supported and provided AS IS. See also LICENSE.
September 26, 2023
Copyright © - Alexander Davronov (a.k.a Hinell), et.al.