0

Vim-Latex is a very big plugin, but the only reason why I use it is that it can complete references \ref{.. and citations \cite{..

I recently created my own latex equation environment, which usually looks something like this:

\begin{my_equation}[my-label]
2+2 = 4
\end{my_equation}

It creates an equation with label "my-label". Now, if in Vim I type \ref{my-lab and press <F9> it does not find the equation. I think this has an obvious answer: somewhere in the code for the Vim-Latex plugin it is written that when I press <F9> the program should look for a snippet of the form \label{my-lab.

I would like to change that piece of the code, so that it also looks for things of the form \begin{my_equation}[my-lab.

Any idea which part of the source code for Vim-Latex I should be checking?

EDIT: I am backpropagating through the source code, and it looks like at least part of the completion can be found under ftplugin/latex-suite/texviewer.vim. But I still don't understand exactly how it works or where to change it.

2
  • 1
    Why would you make that type of environment? If only to suit your own preference and avoid typing the "\label" part, I would claim it is much better to stay with the standards. That makes it easier for instance for collaboration with others. Your custom math environment might also not get proper syntax highlighted. – Karl Yngve Lervåg Jan 29 at 13:52
  • The environment works just fine and makes some things better for me than using equation or align :) Of course, collaborators can still use whatever environment they prefer. Actually I once had a collaborator using his own environment, so it maight be in general useful to be able to tweak the autocompleter. – Kore-N Jan 29 at 13:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.