Created
July 20, 2025 03:41
-
-
Save naranyala/49a874a59960b0cf4d7a7254c3fcf374 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -euo pipefail | |
# Respect XDG spec or fallback to defaults | |
CACHE_DIR="${XDG_CACHE_HOME:-$HOME/.cache}/nvim" | |
STATE_DIR="${XDG_STATE_HOME:-$HOME/.local/state}/nvim" | |
DATA_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/nvim" | |
echo "🧹 Cleaning Neovim directories..." | |
for dir in "$CACHE_DIR" "$STATE_DIR" "$DATA_DIR"; do | |
if [[ -d "$dir" ]]; then | |
echo "🗑️ Removing: $dir" | |
rm -rf "$dir" | |
else | |
echo "⚠️ Skipping missing: $dir" | |
fi | |
mkdir -p "$dir" | |
done | |
echo "✅ Neovim cache/state/data cleaned and reset." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment