Myriad-Dreamin / tinymist

Tinymist [ˈtaɪni mɪst] is an integrated language service for Typst [taɪpst].
https://myriad-dreamin.github.io/tinymist
Apache License 2.0
575 stars 28 forks source link

How do I preview pdf using tinymist in neovim? #475

Closed kamransoomro84 closed 1 month ago

kamransoomro84 commented 2 months ago

I have configured tinymist in neovim and the Hover and snippets are working. But I cannot figure out how to preview my pdf using tinymist like I can do in vscode?

Myriad-Dreamin commented 2 months ago

set export mode to onType and open the exported pdf in your the favorite viewer.

kamransoomro84 commented 2 months ago

It already is set to onType but isn't working apparently. Also does this mean that there's no scrollsyncing like in the vscode extension?

Myriad-Dreamin commented 2 months ago

It already is set to onType but isn't working apparently.

I don't know it and there is no related report since recent months. If there is a bug please send the concrete log.

Also does this mean that there's no scrollsyncing like in the vscode extension?

For pdf preview, no. But you could set up https://github.com/chomosuke/typst-preview.nvim.

Eric-Song-Nop commented 2 months ago

I can confirm that the settings from lspconfig is not read by tinymist server.

Eric-Song-Nop commented 2 months ago

I tested with a vanilla lazyvim with exact same setup as documentation, but I add some log after initialization for tinymist, while the exportPdf setting is always set to "never"

kamransoomro84 commented 2 months ago

I tested with a vanilla lazyvim with exact same setup as documentation, but I add some log after initialization for tinymist, while the exportPdf setting is always set to "never"

What's your config like? I managed to get it to work.

Did you override the lspconfig configuration as shown here?

https://github.com/Myriad-Dreamin/tinymist/blob/main/editors/neovim/plugins/tinymist.lua

And if so, can you confirm that the LSP correctly attached to the buffer when you open a .typ file?

Eric-Song-Nop commented 2 months ago

I followed this setting and tinymist is definitely attached, but it is still not working. but I guess there is something wrong with lazyvim or my sesttings, as I can make it work in a lunarvim setup

Eric-Song-Nop commented 2 months ago

I realized that is was my ufo config conflict with it, it is totally my fault, sorry for taking your time, please ignore eveything from me

Myriad-Dreamin commented 1 month ago

they are already here: https://myriad-dreamin.github.io/tinymist/frontend/neovim.html#label-Configuring%20LSP%20Server.