Home

Awesome

This plugin is no longer being maintained. Unite is no longer maintained, so it makes sense to wind down this too. Here is a much faster replacement for this source, designed for fzf: fzf-bibtex

I can confirm that unite-bibtex still works under the last version of Unite with vim built with Python 2 (although not vim built with Python 3, Neovim, or Denite).

For a variety of reasons (some hinted above), I have switched from Unite to fzf. The new source linked above has no dependency on vim's python version, or indeed on vim (it could be used with another text editor). It looks similar to the picture above, but it is a lot faster than unite-bibtex.

unite-bibtex

A BibTeX source for unite.vim

The keys of the selected candidates are inserted at the cursor.

BibTeX files are listed in the variable g:unite_bibtex_bib_files. The buffer-specific variable b:unite_bibtex_bib_files overrides this. Multiple BibTeX files can be passed to both.

Citations are by default inserted in pandoc's citation format (e.g. @SomeKey93; @AnotherKey94). You can change this, on a per buffer basis, by setting the variables:

Parsing BibTeX databases is computationally intensive, so the source caches the results. The cache is updated if the underlying BibTeX file has been changed. The cache directory is set by g:unite_bibtex_cache_dir. This variable must be set for the source to work.

Requirements

Use

  1. Install bibtexparser: pip2 install bibtexparser
  2. Install unite
  3. Install this plugin (e.g. via vim-plug)
  4. Set variable: let g:unite_bibtex_bib_files=['/path/to/your/bib/file1.bib']
  5. Set variable: let g:unite_bibtex_cache_dir='/path/to/your/temp_dir'
  6. :Unite bibtex in vim
  7. :messages to see any errors or warnings from the BibTeX parser

Variables

The following variables can be set:

bibwatch.py

This plugin includes a separate Python executable, bibwatch.

bibwatch runs in the background in the terminal and watches for changes to selected BibTeX files. Once it detect a change, it updates the corresponding unite-bibtex cache. This means your Unite bibtex source in vim will be populated with zero or minimal lag, even for very large BibTeX databases.

bibwatch is in unite-bibtex/pythonx/core inside the unite-bibtex plugin. Go to this directory in the terminal to run ./bibwatch.py Pass paths to any BibTeX files you want watched. Pass your cache directory (as defined in g:unite_bibtex_cache_dir) as the value of --cache. For example:

./bibwatch.py /path/to/your/bib/file1.bib /path/to/your/bib/file2.bib --cache /path/to/your/temp_dir

Press Control+C to terminate bibwatch.

Troubleshooting

You can correct your .bib file with pybtex:

pip2 install pybtex
pybtex-convert /path/to/your.bib out.bib

Similar projects

Release notes