build: remove synctex test files

This commit is contained in:
Barrett Ruth 2026-03-05 22:37:52 -05:00
parent 23bce48d27
commit 87f2ed4aa2
Signed by: barrett
GPG key ID: A6C96C9349D2FC81
4 changed files with 0 additions and 203 deletions

View file

@ -1,38 +0,0 @@
vim.cmd([[set runtimepath=$VIMRUNTIME]])
vim.opt.runtimepath:append('.')
vim.opt.packpath = {}
vim.opt.loadplugins = false
require('preview.commands').setup()
vim.fn.serverstart('/tmp/nvim-preview.sock')
local synctex_pdf = {}
vim.api.nvim_create_autocmd('User', {
pattern = 'PreviewCompileSuccess',
callback = function(args)
synctex_pdf[args.data.bufnr] = args.data.output
end,
})
vim.g.preview = {
latex = {
open = { 'okular', '--unique' },
output = function(ctx)
return vim.fn.fnamemodify(ctx.file, ':h')
.. '/build/'
.. vim.fn.fnamemodify(ctx.file, ':t:r')
.. '.pdf'
end,
},
}
vim.keymap.set('n', '<leader>s', function()
local pdf = synctex_pdf[vim.api.nvim_get_current_buf()]
if pdf then
vim.fn.jobstart({
'okular', '--unique',
('%s#src:%d:%s'):format(pdf, vim.fn.line('.'), vim.fn.expand('%:p')),
})
end
end)

View file

@ -1,42 +0,0 @@
vim.cmd([[set runtimepath=$VIMRUNTIME]])
vim.opt.runtimepath:append('.')
vim.opt.packpath = {}
vim.opt.loadplugins = false
require('preview.commands').setup()
vim.fn.serverstart('/tmp/nvim-preview.sock')
local synctex_pdf = {}
vim.api.nvim_create_autocmd('User', {
pattern = 'PreviewCompileSuccess',
callback = function(args)
synctex_pdf[args.data.bufnr] = args.data.output
end,
})
vim.g.preview = {
latex = {
open = { 'sioyek', '--instance-name', 'preview' },
output = function(ctx)
return vim.fn.fnamemodify(ctx.file, ':h')
.. '/build/'
.. vim.fn.fnamemodify(ctx.file, ':t:r')
.. '.pdf'
end,
},
}
vim.keymap.set('n', '<leader>s', function()
local pdf = synctex_pdf[vim.api.nvim_get_current_buf()]
if pdf then
vim.fn.jobstart({
'sioyek',
'--instance-name', 'preview',
'--reuse-window',
'--forward-search-file', vim.fn.expand('%:p'),
'--forward-search-line', tostring(vim.fn.line('.')),
pdf,
})
end
end)

View file

@ -1,43 +0,0 @@
vim.cmd([[set runtimepath=$VIMRUNTIME]])
vim.opt.runtimepath:append('.')
vim.opt.packpath = {}
vim.opt.loadplugins = false
require('preview.commands').setup()
vim.fn.serverstart('/tmp/nvim-preview.sock')
local synctex_pdf = {}
vim.api.nvim_create_autocmd('User', {
pattern = 'PreviewCompileSuccess',
callback = function(args)
synctex_pdf[args.data.bufnr] = args.data.output
end,
})
vim.g.preview = {
latex = {
open = {
'zathura',
'--synctex-editor-command',
'nvim --server /tmp/nvim-preview.sock'
.. [[ --remote-expr "execute('b +%{line} %{input}')"]],
},
output = function(ctx)
return vim.fn.fnamemodify(ctx.file, ':h')
.. '/build/'
.. vim.fn.fnamemodify(ctx.file, ':t:r')
.. '.pdf'
end,
},
}
vim.keymap.set('n', '<leader>s', function()
local pdf = synctex_pdf[vim.api.nvim_get_current_buf()]
if pdf then
vim.fn.jobstart({
'zathura', '--synctex-forward',
vim.fn.line('.') .. ':0:' .. vim.fn.expand('%:p'), pdf,
})
end
end)