opout script added for opening .pdfs from vim

This commit is contained in:
Luke Smith
2018-07-30 01:19:40 -04:00
parent 7805bedbce
commit e4a64f6527
3 changed files with 18 additions and 1 deletions

12
.scripts/opout Executable file
View File

@@ -0,0 +1,12 @@
#!/bin/bash
# opout: "open output": A general handler for opening a file's intended output.
# I find this useful especially running from vim.
filename=$(readlink -f "$1")
ext="${filename##*.}"
filename="${filename%.*}"
case "$ext" in
tex|md|rmd) zathura $filename.pdf & ;;
html) $BROWSER --new-window $filename.html & ;;
esac