dotfiles

My personal dotfiles 💠️

texclear (565B)

      1 #!/bin/sh
      2 
      3 # Clears the build files of a LaTeX/XeLaTeX/Aspell build.
      4 # I have vim run this file whenever I exit a .tex file.
      5 
      6 case "$1" in
      7 	*.tex)
      8 	file=$(readlink -f "$1")
      9 	dir=$(dirname "$file")
     10 	base="${file%.*}"
     11 	find "$dir"  -maxdepth 1 -type f -regextype gnu-awk -regex "^$base\\.(4tc|xref|tmp|pyc|pyg|pyo|fls|vrb|fdb_latexmk|swp|aux|log|synctex\\(busy\\)|lof|lot|maf|idx|mtc|mtc0|nav|out|snm|toc|bcf|run\\.xml|synctex\\.gz|blg|bbl|pdf_original)" -delete
     12 	rm -rdf "$dir/_minted-$(basename -- "$base")"
     13 	;;
     14 	*) printf "Give .tex file as argument.\\n" ;;
     15 esac
     16