summaryrefslogtreecommitdiff
path: root/ar/.local/bin/texclear
diff options
context:
space:
mode:
Diffstat (limited to 'ar/.local/bin/texclear')
-rwxr-xr-xar/.local/bin/texclear8
1 files changed, 8 insertions, 0 deletions
diff --git a/ar/.local/bin/texclear b/ar/.local/bin/texclear
new file mode 100755
index 0000000..58f4439
--- /dev/null
+++ b/ar/.local/bin/texclear
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+# Clears the build files of a LaTeX/XeLaTeX build.
+# I have vim run this file whenever I exit a .tex file.
+
+[ "${1##*.}" = "tex" ] && {
+ find "$(dirname "${1}")" -regex '.*\(_minted.*\|.*\.\(4tc\|xref\|tmp\|pyc\|pyg\|pyo\|fls\|vrb\|fdb_latexmk\|bak\|swp\|aux\|log\|synctex\(busy\)\|lof\|lot\|maf\|idx\|mtc\|mtc0\|nav\|out\|snm\|toc\|bcf\|run\.xml\|synctex\.gz\|blg\|bbl\)\)' -delete
+} || printf "Provide a .tex file.\n"