9.2 Performing inverse searches

Most DVI viewers also support inverse searching, whereby you can make the DVI viewer ask vim to display the tex source corresponding to the DVI file being shown. This is extremely helpful while proofreading large documents.

Simply double-click anywhere in the viewer window. If the viewer supports it, then it will attempt to open an editor window at the location corresponding to where you double-clicked. On *nix platforms, Latex-Suite attempts to start the viewer program in such a way that it already knows to use vim to open the tex source. Thus you should see a vim window open up showing the tex file. However, if there is an error, or some other program is used, you will need to tell the viewer program to use gvim as the editor. On windows platforms, if you use the commonly available yap viewer (available as part of the miktex distribution), then this option can be set from View > Options > Inverse Search. In the Command line: window, write

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

(Customize the path according to where you have installed gvim). If you double click in the view pane now, you will see gvim start up and take you to the relevant portion of the tex file.