1

I take notes in markdown files which I sometimes convert to other documents with pandoc. With the --bibliography=bibliography.bib argument, pandoc recognizes the @key citation format in markdown and adds the corresponding bibliographical reference at the end of the document. I would like to use some autocomplete menu to insert those citations based on the keys available in the bib file.

The vimtex plugin autocompletes citations based on a bibtex file. Would it be possible to do the same in markdown files?

1

I hope it's OK to answer my question once again, the answer is easy once you know about the existence of the vim-pandoc plugin, but somehow I couldn't find it directly . I use Vundle to install plugins, added the following to my .vimrc:

" Markdown citation and syntax
Plugin 'vim-pandoc/vim-pandoc'
Plugin 'vim-pandoc/vim-pandoc-syntax'
" Disable folding of vim-pandoc plugin
let g:pandoc#modules#disabled = ["folding"]

Mention a bibliography file in the yaml front matter of the markdown file :

---
title: Reading notes
author: Author Name
bibliography: /path/to/references.bib
abstract: Reading notes with references
---

Then the vim-pandoc plugin can autocomplete @key... references with CTRL X CTRL O based on the keys in the bibliography.

It can look for the bibliography in other places and retrieve suggestions that match in any field using the bibtool program, see :help vim-pandoc-bibliographies-module.

| improve this answer | |
  • 1
    Paul, it is absolutely ok to answer your own question. You can even accept your own answer, but only after 48 hours (maybe someone comes around with a better answer). – Ralf Jun 27 at 5:48

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.