Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeioth committed Nov 8, 2023
1 parent 8516d6e commit 49da96e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ Garbage collector that stops inactive LSP clients to free RAM
</div>

## Why
In many scenarios, unmanaged LSP clients running on background can take several Gb of RAM. So I wrote this LSP garbage collector for [NormalNvim](https://github.com/NormalNvim/NormalNvim) to auto free it. It has no dependencies, so you can use it on any distro.
In many scenarios, unmanaged LSP clients running on background can take several Gb of RAM. So I wrote this LSP garbage collector for [NormalNvim](https://github.com/NormalNvim/NormalNvim) to auto free it. But you can use it on any distro.

## How to setup
Add this to lazy

```lua
{
"zeioth/garbage-day.nvim",
dependencies = "neovim/nvim-lspconfig",
event = "VeryLazy",
opts = {
-- your options here
Expand All @@ -32,15 +33,15 @@ We also support changing opts on execution time like `:let g:garbage_day_config[

| Name | Default | Description |
|--|--|--|
| `grace_period` | `60*15` | Seconds to wait before stopping all LSP clients after neovim loses focus. |
| `aggressive_mode` | `false` | Set it to `true` to stop all lsp clients except the current buffer. `aggressive_mode` operates independently of `grace_period` |
| `excluded_lsp_clients` | `{"null-ls", "jdtls"}` | LSP clients that should never be stopped. Useful for LSP clients that miss behave. |
| `stop_invisible` | `false` | Set it to `true` to enable agressive mode. It stops all LSP clients except the ones attached to the visible buffers every time you change to a different buffer, ignoring the grace period. This ensures the minimum RAM consumption. If your CPU is not very powerful, it might take a few seconds to bring back LSP, so keep this option disabled in that case. |
| `grace_period` | `60*15` | Seconds to wait before stopping all LSP clients after neovim loses focus. |
| `notifications` | `false` | Set it to `true` to get a notification every time LSP clients are stopped. |
| `retries` | `4` | How many seconds should we keep trying to resume a client before giving up. |

## FAQ

* `If it doesn't work`: This plugin has been tested with neovim 0.9 and 0.10. If you are in a neovim version superior to nvim 0.10, and it doesn't work, please [open a issue tagging me](https://github.com/Zeioth/garbage-day.nvim/issues) and I will fix it.
* `If still doesn't work`: Set `stop_invisible` to `false` and try again. If that fixed your issue, please report how to reproduce.

## 🌟 Support the project
If you want to help me, please star this repository to increase the visibility of the project.
Expand Down

0 comments on commit 49da96e

Please sign in to comment.