sponsor Vim development Vim logo Vim Book Ad

tex-labels : Cross reference lables and bibliography items inserted automatically.

 script karma  Rating 8/2, Downloaded by 85  Comments, bugs, improvements  Vim wiki

created by
Bihn Zhou
 
script type
ftplugin
 
description
https://github.com/zhoubihn/tex-labels

1. When a LaTeX file is edited in Vim, any of commands `\ref{}`, `\eqref{}`, `\pageref{}` and `\cite{}` triggers a popup window, with cross reference identifiers or bibliography identifiers listed, each one in a line. In one such line, there is the number of corresponding LaTeX counter (or the label of the cited reference),  the identifier, the page number where it appears in the DVI/PS/PDF file (for cross reference only), the line number and the file name where it is defined by `\label{}` or `\bibitem{}`.  When one of them is selected, the corresponding identifier is automatically inserted in the curly brace around the cursor.
2. Large LaTeX project, containing a main file and several included/input files, is supported.
3. During typing in the identifier for `\label{}` or `\bibitem{}`, existing and potentially conflicting identifiers, if any, are displayed in a popup window. The popup window is automatically closed when there is no longer conflict.
 
install details
cp ftplugin/tex/tex-labels.vim ~/.vim/ftplugin/tex
cp doc/tex-labels.txt ~/.vim/doc

In Vim, :helptags ~/.vim/doc
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
tex-labels.vim 1.3 2025-12-07 9.0 Bihn Zhou Rewrite functions related to \label, \tag and \bibitem.
tex-labels.vim 1.0 2025-11-15 9.0 Bihn Zhou Cross reference and/or bibliographical identifiers aligned well, with relative path of files that can be configured in three ways: relative to the directory of current file, relative to current working directory, and relative to the directory of the main file.
ip used for rating: 216.73.216.158

Questions about Vim should go to the maillist. Help Uganda.     Vim at Github