dotfiles

Cem's Dotfiles
git clone git://git.ckyln.com/dotfiles.git
Log | Files | Refs | Submodules | README | LICENSE

commit c67c89b2fdd919920851d70a474c1d3d2d2ed3ea
parent 79982044b33da51ab95cebf59d687f2cfe8ab27d
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 +