kaarmu / typst.vim

Vim plugin for Typst
MIT License
281 stars 24 forks source link

Specifying pdf viewer does not work #82

Closed patricorgi closed 7 months ago

patricorgi commented 7 months ago

OS version: macOS 14.2.1 (23C71) nvim version: v0.9.5 terminal emulator: wezterm

I installed zathura using brew install zathura and added the following line in my nvim init.lua file.

vim.g.typst_pdf_viewer = "/opt/homebrew/bin/zathura"

However, when I call TypstWatch within nvim, nothing happens.

kaarmu commented 7 months ago

Does it fail when you typst watch <file> --open zathura? I've only been able to test this on Linux and Windows.

patricorgi commented 7 months ago

I have tried the following

typst watch main.typ --open zathura # -> no pdf viewer opened
typst watch main.typ --open $(which zathura) # -> no pdf viewer opened
typst watch main.typ --open # -> default OS pdf viewer opened (Preview.app in this case)

They all print out following message in terminal, and no error is shown.

watching main.typ
writing to main.pdf

[21:09:21] compiled successfully in 3.30s

However, I can open this main.pdf file fine in zathura with

zathura main.pdf

This makes me think it is a bug on typst side, and not really typst.vim. :)

kaarmu commented 7 months ago

Great! Yea, that confirms it is an upstream problem. I only call typst watch main.typ --open <typst_pdf_viewer>.