6

I have been using Vim for coding LaTeX files for some time now, but did not like vim-latex at first sight and therefore never used it.

However the the project-wide(!) ref/cite completion of vim-latex seems to pretty awesome. Long story short: I would like to use this single feature, but nothing else. No magic, no (other) mappings, nothing.

How to do that? (In a perfect world I would also like to be able to add more and more features of vim-latex as I like, just not all of them at once. I am a creature of habit.)

  • 1
    Maybe consider a more light weight plugin such as github.com/LaTeX-Box-Team/LaTeX-Box – FDinoff May 4 '15 at 18:30
  • @FDinoff: Oh yes, using another plugin which also has this feature could work as well. :) – Keba May 4 '15 at 18:39
5

I can not answer your question regarding vim-latex (aka LaTeX-Suite), however, I can recommend two plugins that provide good label and bibliography completion:

vimtex

Vimtex is a simple and lightweight LaTeX plugin for vim that is initially based on LaTeX-Box. The code is now very much diverged from LaTeX-Box, and the plugin is IMHO better maintained and more actively developed. Disclaimer: vimtex is written and maintained by me.

As for your question, vimtex supports a modular approach where you may enable/disable functionality that you want to use. If you only want the completion functionality, then you may achieve this in vimtex by disabling all the other functionalities. Place the following in your vimrc file:

let g:vimtex_fold_enabled = 0
let g:vimtex_indent_enabled = 0
let g:vimtex_indent_bib_enabled = 0
let g:vimtex_labels_enabled = 0
let g:vimtex_toc_enabled = 0
let g:vimtex_mappings_enabled = 0
let g:vimtex_motion_enabled = 0
let g:vimtex_latexmk_enabled = 0
let g:vimtex_view_enabled = 0

Alternatively, you can disable vimtex completely and then only enable the completion:

let g:vimtex_enabled = 0
call vimtex#complete#init(0)

LaTeX-Box

In LaTeX-Box one can not selectively enable or disable functionality (I believe), but it is a simple and lightweight plugin with good completion functionality.

  • Honestly, vimtex seems to be way better then LaTeX-Box. I spent the last hour copying vim-latex‘ *.latexmain behavior, that‘s not needed here. Also you completions show \tag{foo} tags, that‘s also nice. – Keba May 4 '15 at 21:57
  • Thanks @Keba! I appreciate the feedback. Please don't hesitate to open issues if you find any bugs/have any problems/have ideas for new features. – Karl Yngve Lervåg May 5 '15 at 6:02
  • 1
    As you may have noticed, I already did that (on github). :) – Keba May 5 '15 at 16:29

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.