vdotfiles

Cem's Dotfiles for Void Linux
git clone git://git.ckyln.com/vdotfiles.git
Log | Files | Refs | Submodules | README | LICENSE

commit 90dd07059d76d1835389402cc437053013cb8472
parent 4d1965e9ec2eb65e1cf0b34f4e992f04f8b1241b
Author: Cem Keylan <cem@ckyln.com>
Date:   Mon, 11 Nov 2019 18:29:54 +0300

clear tex build files after exit

Diffstat:
M.config/nvim/init.vim | 3+++
A.local/bin/texclear | 16++++++++++++++++
2 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim @@ -66,3 +66,6 @@ let g:syntastic_tex_chktex_post_args = "-n 8 -n 24" " Syntastic shell let g:syntastic_sh_checkers = ["shellcheck", "checkbashisms", "sh"] let g:syntastic_sh_shellcheck_post_args = "-e SC2145 -e SC2015 -e SC2162 -e SC1090" + +" Clear tex build files after exit +autocmd VimLeave *.tex !texclear % diff --git a/.local/bin/texclear b/.local/bin/texclear @@ -0,0 +1,16 @@ +#!/usr/bin/env sh + +# Taken from Luke Smith + +# Clears the build files of a LaTeX/XeLaTeX build. +# I have vim run this file whenever I exit a .tex file. + +case "$1" in + *.tex) + file=$(readlink -f "$1") + dir=$(dirname "$file") + base="${file%.*}" + find "$dir" -maxdepth 1 -type f -regextype gnu-awk -regex "^$base\\.(4tc|xref|tmp|pyc|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 "Give .tex file as argument.\\n" ;; +esac +