Skip to content

Neovim's plugins are small. The language servers Mason installs for them are not

Mason downloads language servers, formatters and debuggers into your Neovim data folder, some of them hundreds of MB. Where they are and how to prune.

4 min read

A Neovim config pulls in plugins, which are small, and through Mason, language servers and tools, which are not. A Java or C# language server alone can be hundreds of MB. Many people installed a dozen while trying a distribution.

du -sh ~/.local/share/nvim ~/.local/state/nvim ~/.cache/nvim 2>/dev/null
du -sh ~/.local/share/nvim/mason/packages/* 2>/dev/null | sort -h | tail

Clean up

  • In Neovim, :Mason lists installed tools. Press X on one to uninstall it.
  • :Lazy clean removes plugins no longer in your config, if you use lazy.nvim.
  • ~/.local/state/nvim holds logs, undo history and swap files. The log files can be deleted.
  • ~/.cache/nvim is safe to clear.

If you tried several Neovim distributions, each may have its own data folder named after its NVIM_APPNAME, like ~/.local/share/lazyvim. Remove the ones you do not use.

ls -d ~/.local/share/*vim* ~/.config/*vim* 2>/dev/null

Other editors: VS Code, JetBrains caches.

Related: LuaRocks trees.

Common questions

Where does Mason install language servers?

In ~/.local/share/nvim/mason, with one folder per package.

How do I remove Mason packages?

Open :Mason in Neovim and press X on a package to uninstall it.

Can I delete ~/.cache/nvim?

Yes. It holds caches that Neovim and plugins rebuild.

Read next