typst.lua 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. return {
  2. { "kaarmu/typst.vim", ft = "typst", lazy = false },
  3. {
  4. "chomosuke/typst-preview.nvim",
  5. lazy = false, -- or ft = 'typst'
  6. version = "0.3.*",
  7. config = function()
  8. require("typst-preview").setup({
  9. -- Setting this true will enable printing debug information with print()
  10. debug = false,
  11. -- Custom format string to open the output link provided with %s
  12. -- Example: open_cmd = 'firefox %s -P typst-preview --class typst-preview'
  13. open_cmd = nil,
  14. -- Setting this to 'always' will invert black and white in the preview
  15. -- Setting this to 'auto' will invert depending if the browser has enable
  16. -- dark mode
  17. invert_colors = "never",
  18. -- Whether the preview will follow the cursor in the source file
  19. follow_cursor = true,
  20. -- Provide the path to binaries for dependencies.
  21. -- Setting this will skip the download of the binary by the plugin.
  22. -- Warning: Be aware that your version might be older than the one
  23. -- required.
  24. dependencies_bin = {
  25. -- if you are using tinymist, just set ['typst-preview'] = "tinymist".
  26. ["typst-preview"] = nil,
  27. ["websocat"] = nil,
  28. },
  29. -- This function will be called to determine the root of the typst project
  30. get_root = function(path_of_main_file)
  31. return vim.fn.fnamemodify(path_of_main_file, ":p:h")
  32. end,
  33. -- This function will be called to determine the main file of the typst
  34. -- project.
  35. get_main_file = function(path_of_buffer)
  36. return path_of_buffer
  37. end,
  38. })
  39. end,
  40. build = function()
  41. require("typst-preview").update()
  42. end,
  43. },
  44. }