1
0
mirror of https://github.com/tiyn/dotfiles.git synced 2025-10-09 19:11:15 +02:00

multiple changes for nvim

- tex snippets were changed for listed and unlisted sections
- nvim autocompletion engine was swapped to nvim-cmp
- nvim clears more files when exiting tex files
- the compiler uses biber when compiling tex files
- sc-im is used for .sc filetypes when using vifm
This commit is contained in:
2021-11-10 03:25:28 +01:00
parent 745d1a6321
commit 7129be044e
5 changed files with 48 additions and 31 deletions

View File

@@ -9,6 +9,7 @@
file=$(readlink -f "$1")
dir=$(dirname "$file")
base="${file%.*}"
basenodir="${1%.*}"
cd "$dir" || exit
@@ -19,6 +20,7 @@ textype() { \
grep -i addbibresource "$file" >/dev/null &&
biber --input-directory "$dir" "$base" &&
$command --output-directory="$dir" "$base" &&
makeglossaries "$basenodir" &&
$command --output-directory="$dir" "$base"
}
@@ -27,10 +29,10 @@ case "$file" in
*\.mom) refer -PS -e "$file" | groff -mom -kept -T pdf > "$base".pdf ;;
*\.[0-9]) refer -PS -e "$file" | groff -mandoc -T pdf > "$base".pdf ;;
*\.rmd) echo "require(rmarkdown); render('$file')" | R -q --vanilla ;;
*\.tex) textype "$file" ;;
*\.m) octave -qW "$file" ;;
*\.md) pandoc "$file" --pdf-engine=xelatex -o "$base".pdf ;;
*config.h) sudo make install ;;
*\.tex) textype "$file" ;;
*\.java) java "$file" ;;
*\.js) node "$file" ;;
*\.c) if [ -f Makefile ]; then make run; else cc "$file" -o "$base" && "$base"; fi ;;
@@ -40,3 +42,4 @@ case "$file" in
*\.sent) setsid sent "$file" 2>/dev/null & ;;
*) sed 1q "$file" | grep "^#!/" | sed "s/^#!//" | xargs -r -I % "$file" ;;
esac

View File

@@ -10,7 +10,8 @@ case "$1" in
dir=$(dirname "$file")
base="${file%.*}"
if [ -f "$dir/indent.log" ]; then rm "$dir/indent.log"; fi
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 ;;
find "$dir" -maxdepth 1 -type f -regextype gnu-awk -regex "^$base\\.(4tc|xref|tmp|pyc|pyo|fls|vrb|fdb_latexmk|bak|swp|log|synctex\\(busy\\)|lof|lot|maf|idx|mtc|mtc0|nav|out|snm|toc|bcf|run\\.xml|synctex\\.gz|blg|bbl|glg|glo|gls|glsdefs|ilg|ist|acn|acr|alg)" -delete ;
find "$dir" -maxdepth 1 -type f -regextype gnu-awk -regex ".*\\.aux" -delete ;;
*) printf "Give .tex file as argument.\\n" ;;
esac