I just started using Zathura to view pdfs while editing tex files.

I am trying to have forward searching capability in Zathura.

Using the LaTeX-Box plugin in Vim, I have added the following in my vimrc:

let g:LatexBox_viewer= '/usr/bin/zathura --fork --synctex-editor-command "vim --servername VIM --remote +\%{line} \%{input}"'

This gives me backward searching capability when I open a tex file with:

vim --servername VIM filename.tex

and open the corresponding PDF file by typing <LocalLeader>lv (this automatically opens the corresponding PDF file in Zathura).

But I do not know how to have forward searching.

  • 1
    Forward search with zathura should work out of the box with vimtex. If you like LaTeX-Box, then you might also like vimtex, as it was originally based off of LaTeX-Box. Sep 15, 2015 at 7:29
  • @KarlYngveLervåg funnily enough my googling led me to this: github.com/lervag/vimtex/issues/118 Tried a bit to get LaTeX-Box to work building on suggestions there, but got bored.
    – muru
    Sep 16, 2015 at 19:58
  • @muru Yes, I also find this stuff to be quite a hazzle. I am relatively happy with how it works in my plugin right now (although there are still room for many improvements, I guess). If caffeinemachine wants to keep using LaTeX-Box, the issue you've linked to might provide some helpful answers. Sep 16, 2015 at 21:14

1 Answer 1


First you must compile your doc with synctex option: To do reverse search add the following:

# Adding reverse search between gvim and zathura
set synctex true
set synctex-editor-command "gvim --remote-silent +%{line} %{input}"

to your zathurarc file (Usually it can be find in your $HOME/.config/zathura folder). You can jump to line 150 column 2 by running:

zathura --synctex-forward 150:2:foo.tex foo.pdf

See also How to do reverse and forward search using vim and zathura.

  • 1
    Welcome to Vi and Vim! The network in general discourages link-only answers (because of link-rot, for one). Please edit your answer to include more details and provide an actual solution.
    – D. Ben Knoble
    Nov 2, 2019 at 19:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.