nvim-snappy/lua/plugins/langs/typst/typst-preview.lua

58 lines
1.3 KiB
Lua

return {
-- Fix tinymist Check
'Parsifa1/typst-preview.nvim',
commit = '8c5dbd5175e39444185f48d16819d18a549c10b2',
--'chomosuke/typst-preview.nvim',
--commit = 'df393b47c5bc35abe4d60bb479afd0c15802fda8',
lazy = true,
cmd = {
'TypstPreviewUpdate',
'TypstPreview',
'TypstPreviewStop',
'TypstPreviewToggle',
'TypstPreviewFollowCursor',
'TypstPreviewNoFollowCursor',
'TypstPreviewFollowCursorToggle',
'TypstPreviewSyncCursor',
},
keys = {
{
'<leader>fp',
function()
vim.cmd('TypstPreview')
end,
desc = '[F]ile(typst) [P]review On',
ft = 'typst',
},
{
'<leader>fP',
function()
vim.cmd('TypstPreviewStop')
end,
desc = '[F]ile(typst) [P]review Off',
ft = 'typst',
},
{
'<leader>fs',
function()
vim.cmd('TypstPreviewSyncCursor')
end,
desc = '[F]ile(typst) [S]ync Cursor',
ft = 'typst',
},
},
opts = {
debug = false,
open_cmd = 'firefox %s --no-remote --profile '.. vim.fn.stdpath('config') .. '/firefox-profiles/typst-preview --class typst-preview',
--open_cmd = 'chromium --temp-profile --disable-plugins --app=%s',
follow_cursor = true,
dependencies_bin = {
['tinymist'] = vim.env.HOME .. '/.cargo/bin/tinymist',
['websocat'] = vim.env.HOME .. '/.cargo/bin/websocat',
},
},
}