chomosuke / typst-preview.nvim

Low latency typst preview for Neovim
GNU General Public License v3.0
254 stars 16 forks source link

Other version of typst-preview binary #15

Closed Isrothy closed 7 months ago

Isrothy commented 8 months ago

First of all, thank you for your execellent plugin.

I recently find this plugin dosen't work with my typst file. But the vscode plugin works fine.

Then I came up with a hack, which is replacing the one in vim.fn.stdpath 'data' .. '/typst-preview/ by the vscode one. And it works.

I wounder if it can be possible to add a configuration option in setup() to set the path of typst-preview cli program?

chomosuke commented 8 months ago

Yes, I agree it would be nice. I don't have any time to work on this anytime soon but I would be happy to review a PR if you'd like to create one.

You might find #11 a good example of adding a option to setup().

EGmux commented 8 months ago

What worked for me was noticing that the autoCmds are only properly registered if typst-preview.nvim recognizes the file as .typ in the cwd.

So I downloaded the ftdetect file from this repo https://github.com/kaarmu/typst.vim/tree/main/ftdetect and placed in .config/nvim/ftdetect and it worked.