Skip to content

Instantly share code, notes, and snippets.

@nimeshneema
Created February 28, 2026 00:34
Show Gist options
  • Select an option

  • Save nimeshneema/a7f947a7d1c952d6dc953efcdaaa1822 to your computer and use it in GitHub Desktop.

Select an option

Save nimeshneema/a7f947a7d1c952d6dc953efcdaaa1822 to your computer and use it in GitHub Desktop.
# Backup first (just in case)
cp -r ~/.emacs.d ~/.emacs.d.backup.$(date +%Y%m%d)
# Remove all installed packages and elpa directory
rm -rf ~/.emacs.d/elpa
rm -rf ~/.emacs.d/lsp-session*
rm -rf ~/.emacs.d/.lsp-session*
# Remove any Metals server installations managed by lsp-metals
# (lsp-metals installs metals under this path by default)
rm -rf ~/.local/share/coursier/bin/metals
rm -rf ~/.cache/metals
rm -rf ~/.metals # project-local metals caches will be in project dirs
# Also clear any .metals and .bloop directories in your project dirs
# (do this per-project when you first open them):
# find ~/your-projects -name ".metals" -type d -exec rm -rf {} +
# find ~/your-projects -name ".bloop" -type d -exec rm -rf {} +
# Now write a fresh init.el
> ~/.emacs.d/init.el
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment