7.2 Forward Searching documents

Forward searching refers to making a viewer display a given document at a given location from within Vim. At present, these viewers are known to support forward searching, but viewers that are not listed here may work, too:

ViewerOSSupported documentsComment
SkimApple / OS X TigerPDFSupports also inverse searching
PDFViewApple / OS XPDFNo longer in development, supports also inverse searching
TeXniscopeApplePDF, DVI 
YAPWindowsDVI, PSships with MikTex
Sumatra PDFWindowsPDF 
kdviLinux/UNIXDVI 
okularLinux/UNIXDVI, PDF, PS and many moreIncluded in KDE 4
xdviLinux/UNIXDVI 
xdvikLinux/UNIXDVI 

Pressing \ls from within Vim should make the viewer display the portion of the document where your cursor is placed.

Note

OS/X users need to set the g:Tex_TreatMacViewerAsUNIX flag to 1 and provide a UNIX-like viewrule, that expects as arguments the document, the linenumber and the sourcefile in this order.

Enabling Forward and Inverse Searching

Most DVI viewers need "source-special" information in order to do forward (and inverse) searching. This information is embedded in the dvi file if the LaTeX source is compiled with the --src-specials option. By default, Latex-Suite does not supply this argument to the compiler. See the section on g:Tex_CompileRule_dvi to find out how this option can be set.

Pdf viewers usually use a synctex(.gz) file. This can be enabled with the compiler flag

-synctex=1

for pdflatex. Within this suite it is however enabled by default, unless you change g:Tex_CompileRule_pdf.