fix(nvim): simplified setup

This commit is contained in:
Barrett Ruth 2026-03-05 22:08:14 -05:00
parent 36a88dc982
commit 615f4c1868
Signed by: barrett
GPG key ID: A6C96C9349D2FC81

View file

@ -308,6 +308,7 @@ return {
end, end,
}) })
vim.api.nvim_create_autocmd('CursorHold', { vim.api.nvim_create_autocmd('CursorHold', {
group = vim.api.nvim_create_augroup('APreviewSynctex', { clear = true }),
pattern = '*.tex', pattern = '*.tex',
callback = function() callback = function()
local pdf = synctex_pdf[vim.api.nvim_get_current_buf()] local pdf = synctex_pdf[vim.api.nvim_get_current_buf()]
@ -329,22 +330,13 @@ return {
mermaid = true, mermaid = true,
latex = { latex = {
open = { 'sioyek', '--instance-name', 'preview' }, open = { 'sioyek', '--instance-name', 'preview' },
extra_args = { '-outdir=build' },
output = function(ctx) output = function(ctx)
return vim.fn.fnamemodify(ctx.file, ':h') return vim.fn.fnamemodify(ctx.file, ':h')
.. '/build/' .. '/build/'
.. vim.fn.fnamemodify(ctx.file, ':t:r') .. vim.fn.fnamemodify(ctx.file, ':t:r')
.. '.pdf' .. '.pdf'
end, end,
args = function(ctx)
return {
'-pdf',
'-interaction=nonstopmode',
'-synctex=1',
'-outdir=build',
'-pdflatex=pdflatex -file-line-error -interaction=nonstopmode %O %S',
ctx.file,
}
end,
}, },
} }
end, end,