feat(nvim): use render.nvim

This commit is contained in:
Barrett Ruth 2026-03-01 17:30:15 -05:00
parent 639f1a4eac
commit 339840a602
Signed by: barrett
GPG key ID: A6C96C9349D2FC81
3 changed files with 52 additions and 34 deletions

View file

@ -6,6 +6,7 @@ local dev_plugins = {
'pending.nvim',
'cp.nvim',
'diffs.nvim',
'render.nvim',
}
local opt_dir = vim.fn.stdpath('data') .. '/site/pack/dev/opt/'
@ -406,4 +407,42 @@ return {
}
end,
},
{
'barrettruth/render.nvim',
ft = { 'typst', 'tex' },
before = function()
vim.g.render = {
providers = {
typst = {
cmd = { 'typst', 'compile' },
args = function(ctx)
return { ctx.file }
end,
output = function(ctx)
return ctx.file:gsub('%.typ$', '.pdf')
end,
},
latexmk = {
cmd = { 'latexmk' },
args = function(ctx)
return { '-pdf', '-interaction=nonstopmode', ctx.file }
end,
output = function(ctx)
return ctx.file:gsub('%.tex$', '.pdf')
end,
clean = { 'latexmk', '-c' },
},
},
providers_by_ft = {
typst = 'typst',
tex = 'latexmk',
},
}
end,
keys = {
{ '<leader>rr', '<cmd>Render compile<cr>' },
{ '<leader>rs', '<cmd>Render stop<cr>' },
{ '<leader>rc', '<cmd>Render clean<cr>' },
},
},
}

View file

@ -8,7 +8,6 @@ vim.pack.add({
'https://github.com/tpope/vim-abolish',
'https://github.com/tpope/vim-sleuth',
'https://github.com/kylechui/nvim-surround',
'https://github.com/lervag/vimtex',
}, { load = function() end })
return {
@ -132,14 +131,6 @@ return {
{ 'i', mode = { 'x', 'o' } },
},
},
{
'lervag/vimtex',
ft = { 'latex' },
before = function()
vim.g.vimtex_view_method = 'sioyek'
vim.g.vimtex_quickfix_mode = 0
end,
},
{
'monaqa/dial.nvim',
after = function()