- In a script called 'vimura':
#!/bin/sh
echo $1
zathura -s -x "gvim --servername $1 -c \"let g:syncpdf='$1'\" --remote +%{line} %{input}" $*
For zathura >= 0.3.2 remove -s
.
- In your vimrc:
function! Synctex()
" remove 'silent' for debugging
execute "silent !zathura --synctex-forward " . line('.') . ":" . col('.') . ":" . bufname('%') . " " . g:syncpdf
endfunction
map <C-enter> :call Synctex()<cr>
- Build your latex doc with synctex enabled
pdflatex -synctex=1 ...
-
Open PDF with vimura script.
-
CTRL+Click
in Zathura jumps to source in vim. -
CTRL+Enter
in vim jumps to corresponding position in PDF.
Thank you so much, I tried to make
synctex
work withevince
but eventually gave up. Now I can finally fully enjoy the power ofvim
without any regret. Only one question: is there any way to make this work by startinggvim
first and then openingzathura
with\ll
?