Forward & inverse searching with Vim, Xdvi and LaTeX
I’ve finally found out how to do the forward & inverse searching with (g)vim in combination with vim-latex and xdvi. For forward searching one adds the following line to the .vimrc
let g:Tex_CompileRule_dvi = 'latex --interaction=nonstopmode --src-specials $*'
For inverse searching one opens gvim using the following option
gvim --servername xdvi file.tex
and the xdvi using
xdvi -editor "gvim --servername xdvi --remote +%l %f" file.dvi
Yes, there’s only one dash in front of the editor option!
Additionally, if one wants the \lv command calling xdvi with this option, one inserts the following line to the .vimrc file
let g:Tex_ViewRuleComplete_dvi = 'xdvi -editor "gvim --servername xdvi --remote +\%l \%f" $* &'
It took quite some time to get the inverse searching working… Anyway, it’s working now: \ls for the forward and control-click for the inverse searching. It’s just GREAT!

November 9th, 2009 at 4:59 am
Forward search does not work for me. I see a \\\\\\\\":call Tex_ForwardSearchLaTeX()\\\\\\\\" on the bottom of vim, but the dvi file in xdvi always shows the top..
November 21st, 2009 at 8:34 pm
Hm, I see now that the forward search does not work on my, oops, sorry, what I mean was, on the group laptop. I don’t yet know what’s the problem. I’ll try to figure it out…
December 21st, 2009 at 3:28 pm
[...] is an update to the entry about gvim + xdvi. I found out why the forward search did not work: It was as always a trivial reason… I forgot [...]