diff --git a/.config/helix/scripts/typst-zathura.fish b/.config/helix/scripts/typst-zathura.fish index 2730e841..46b3db68 100755 --- a/.config/helix/scripts/typst-zathura.fish +++ b/.config/helix/scripts/typst-zathura.fish @@ -5,8 +5,14 @@ set -l src (path resolve $argv[1]) # string replace set -l targ (string replace --filter '.typ' '.pdf' $src) if test -f "$targ" - - echo $targ + zathura "$targ" &>/dev/null & else - echo no file + # no such file in current dir, time to search! + # if we're in a git repo, search from root + # if we're not, search from cwd + if git rev-parse --is-inside-work-tree &>/dev/null + echo in git + else + echo out git + end end