diff options
| author | Luke Smith <luke@lukesmith.xyz> | 2018-07-30 01:19:40 -0400 |
|---|---|---|
| committer | Luke Smith <luke@lukesmith.xyz> | 2018-07-30 01:19:40 -0400 |
| commit | e4a64f6527936e85541f52a34384d15f70ea9872 (patch) | |
| tree | 3bfa1f3bd47f576355468f86aae87347c83327be /.scripts | |
| parent | 7805bedbce0cb018404d581a8b91961a26d67815 (diff) | |
| download | eibhear-e4a64f6527936e85541f52a34384d15f70ea9872.tar.gz eibhear-e4a64f6527936e85541f52a34384d15f70ea9872.tar.zst eibhear-e4a64f6527936e85541f52a34384d15f70ea9872.zip | |
opout script added for opening .pdfs from vim
Diffstat (limited to '.scripts')
| -rw-r--r-- | .scripts/SCRIPTS.md | 5 | ||||
| -rwxr-xr-x | .scripts/opout | 12 |
2 files changed, 17 insertions, 0 deletions
diff --git a/.scripts/SCRIPTS.md b/.scripts/SCRIPTS.md index 5d01c03..42a866e 100644 --- a/.scripts/SCRIPTS.md +++ b/.scripts/SCRIPTS.md @@ -93,6 +93,11 @@ be paused and the screen will be distorted and locked and screen will soon time ## `musstuff` Some old notes and commands on deleted music shortcuts. +## `opout` +"Open output", opens the corresponding `.pdf` file if run on a `.md`, `.tex` or +`.rmd` file, or if given an `.html` file, will open it in the browser. +Bound to `<leader>p` in my vim config to reveal typical output. + ## `pauseallmpv` Pauses all mpv instances by sending the `,` key to each. Used by several scripts, but can be used alone as well. diff --git a/.scripts/opout b/.scripts/opout new file mode 100755 index 0000000..28dcafd --- /dev/null +++ b/.scripts/opout @@ -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 |
