Skip to content

Instantly share code, notes, and snippets.

@yugoslavskiy
Forked from gerardroche/sublime-clean
Last active April 26, 2016 01:19
Show Gist options
  • Save yugoslavskiy/8c51a6af08b58f42dccc to your computer and use it in GitHub Desktop.
Save yugoslavskiy/8c51a6af08b58f42dccc to your computer and use it in GitHub Desktop.
Script to clean Sublime Text 3 caches, sessions and workspaces
#!/bin/sh
# original file:
# https://gist.github.com/gerardroche/6e46cbdf8da19a39f9da
set -e
unset CDPATH
unset IFS
[ $( uname -s ) = "Darwin" ] && ST3_PATH=~/Library/Application\ Support/Sublime\ Text\ 3
[ $( uname -s ) = "Linux" ] && ST3_PATH=~/.config/sublime-text-3
echo "[*] remove cache..."
rm -rfv "${ST3_PATH}"/Packages/.logs/
rm -rfv "${ST3_PATH}"/Backup/
rm -rfv "${ST3_PATH}"/Cache/
rm -rfv "${ST3_PATH}"/Index/
rm -rfv "${ST3_PATH}"/Settings/
echo "[*] remove sesions..."
rm -fv "${ST3_PATH}"/Local/*.sublime_session
echo "[*] remove workspaces..."
sudo find / -type f -name '*.sublime-workspace' -exec rm -fv {} + 2>/dev/null
echo ""
echo "[*] sublime-clean: Done."
echo ""
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment