[Tex/LaTex] How to get vim-latex’s \cite completion to work

citingvim

I'm having issues with \cite completion. In the screenshot below, you can see what I get when I do \cite{ } F9. It is not doing what documentation says it would do, such as:

  • Show a list that I can explore using n and p. n and p don't do anything.
  • Show the ability to filter. f doesn't do anything.
  • Also, if I remember correctly, it is supposed to search based on the few letters typed. So if I typed \cite{foo and then F9 it would show citations that start with foo. Instead, it is always showing me the list of citations starting at the same place, which happens to be the top of biblio.bib.

screenshot

I recently set up my vim, so I am probably doing something wrong. Here is my .vimrc and, not that it matters, here are the tex files I am editing. You can see I do have a main.tex.latexmain file as recommended. I even tried setting biblio.bib's directory path in g:Tex_ProjectSourceFiles but it didn't solve the issue. I also tried disabling some of my other plugins by moving them to a different directory but didn't help either. Am I missing something obvious?

Best Answer

I would suggest setting up a minimal working example to confirm that the problem is with the gvim setup rather than in the other files and file locations.

In the same directory, a test .tex file of:

\documentclass{article}
\bibliographystyle{amsplain}
\begin{document}
test
\bibliography{TeX}
\end{document}

and a TeX.bib of

@book{diller97,
    author = "Antoni Diller",
    title = "{\LaTeX} Line by Line",
    year = "1997",
    edition = "1st",
    publisher = "Wiley",
    address = "Chichester, England"
}

@book{goossens99,
    author = "Michel Goossens and Sebastian Rahtz",
    title = "The {\LaTeX} Web Companion",
    year = "1999",
    edition = "1st",
    publisher = "Addison-Wesley",
    address = "Boston, Massachusetts"
}

works for my set-up when adding the line \cite{} after the line test and then pressing F9.

A second check: is vim-latexsuite is working for other functions? For example, with gvim, there would usually be several 'TeX-...' entries on the main menu. vim-latexsuite on some systems must be both installed and then manually set up. For example, on Ubuntu 11.04, you have to set up latexsuite after installation via synaptic:

By default, vim-latexsuite is not enabled. Please read /usr/share/doc/vim-latexsuite/README.Debian after installing the package.

FWIW, my directory ~/.vim has subdirectories that include one, ftplugin, that, in turn, contains another subdirectory, latex-suite, but also two files: bib_latexSuite.vim and tex_latexSuite.vim. Unless you're also running Ubuntu 11.04 I would not expect exactly the same files but I would expect some files relating to latexsuite and to bib in the .vim directory in your home directory (if you are using GNU/Linux).

Related Question