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!

Tags: ,

3 Responses to “Forward & inverse searching with Vim, Xdvi and LaTeX”

  1. George Says:

    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.. :(

  2. Tae Says:

    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…

  3. tae’s log » Blog Archive » Update on the usage of gvim + xdvi Says:

    [...] 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 [...]

Leave a Reply