fix(nvim): cleanup
This commit is contained in:
parent
f969cacdff
commit
36a88dc982
1 changed files with 15 additions and 18 deletions
|
|
@ -307,6 +307,21 @@ return {
|
||||||
synctex_pdf[args.data.bufnr] = args.data.output
|
synctex_pdf[args.data.bufnr] = args.data.output
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
vim.api.nvim_create_autocmd('CursorHold', {
|
||||||
|
pattern = '*.tex',
|
||||||
|
callback = function()
|
||||||
|
local pdf = synctex_pdf[vim.api.nvim_get_current_buf()]
|
||||||
|
if pdf then
|
||||||
|
vim.fn.jobstart({
|
||||||
|
'sioyek',
|
||||||
|
'--instance-name', 'preview',
|
||||||
|
'--forward-search-file', vim.fn.expand('%:p'),
|
||||||
|
'--forward-search-line', tostring(vim.fn.line('.')),
|
||||||
|
pdf,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
vim.g.preview = {
|
vim.g.preview = {
|
||||||
github = true,
|
github = true,
|
||||||
typst = { open = { 'sioyek', '--new-instance' } },
|
typst = { open = { 'sioyek', '--new-instance' } },
|
||||||
|
|
@ -336,23 +351,5 @@ return {
|
||||||
keys = {
|
keys = {
|
||||||
{ '<leader>p', '<cmd>Preview toggle<cr>' },
|
{ '<leader>p', '<cmd>Preview toggle<cr>' },
|
||||||
},
|
},
|
||||||
after = function()
|
|
||||||
local function forward_search()
|
|
||||||
local pdf = synctex_pdf[vim.api.nvim_get_current_buf()]
|
|
||||||
if pdf then
|
|
||||||
vim.fn.jobstart({
|
|
||||||
'sioyek',
|
|
||||||
'--instance-name', 'preview',
|
|
||||||
'--forward-search-file', vim.fn.expand('%:p'),
|
|
||||||
'--forward-search-line', tostring(vim.fn.line('.')),
|
|
||||||
pdf,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
end
|
|
||||||
vim.api.nvim_create_autocmd('CursorHold', {
|
|
||||||
pattern = '*.tex',
|
|
||||||
callback = forward_search,
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue