Closed centipedesquad closed 1 week ago
I use reverse search in my neovim + skim setup. My latex file are folded by default and the folds are set to open automatically by a
jump
action. However, while the inverse search works and the cursor “jumps” to the correct line, it doesn't unfold the code. Hence, the cursor stays in the first line of the folded group.
You can specify to unfold by attaching to an event. Read :help vimtex-events
for the relevant docs. Here is an example that I think should for with Lua; you can put the code where you put your regular VimTeX configuration.
local au_group = vim.api.nvim_create_augroup("vimtex_events", {})
vim.api.nvim_create_autocmd("User", {
group = au_group,
pattern = "VimtexEventViewReverse",
command = "normal! zMzvzz"
})
Thanks 🥇 !
My pleasure :)
Description
I use reverse search in my neovim + skim setup. My latex file are folded by default and the folds are set to open automatically by a
jump
action. However, while the inverse search works and the cursor “jumps” to the correct line, it doesn't unfold the code. Hence, the cursor stays in the first line of the folded group.Here is the relevant section of my init file:
Steps to reproduce
<C-S> + leftclick
on some region of the pdfExpected behavior
The cursor to return to the correct line inside the folded group with the code unfolded.
Actual behavior
No response
Do you use a latexmkrc file?
No
VimtexInfo