7.3 Inverse Searching

Inverse searching refers to a viewer (either pdf or dvi) telling Vim to display the LaTeX source file at a given location. Usually this happens with double-clicking or clicking while pressing the shift/control button in the viewer window. The actual method depends on the viewer application.

You will need to enable searching in order to use this functionality.

You will also need to specify certain settings to the viewer conveying the syntax which it needs to use to tell Vim how to display the source file.

In windows you need to supply the following command in the apporpriate setting of your viewer:

"C:\Program Files\vim\vim74\gvim" -c ":RemoteOpen +%l %f"

Or if you have (g)Vim added to your $PATH simply:

gvim -c ":RemoteOpen +%l %f"

The command :RemoteOpen is supplied when you install Latex-Suite. In YAP, you can set this option under View > Options > Inverse Search in the Command Line field. And in SumatraPdf you can set this option under Settings > Options > Set inverse search command-line.

On *nix machines, Latex-Suite attempts to call the DVI viewer in such a way that it already knows how to communicate with Vim. If this does not seem to be working, you can use the RemoteOpen command described above.