1

I write in pandoc markdown, which uses bibligraphic keys from biblatex that look like @smith_foo_1999, where "Smith" is the author name, "Foo" is the title, and 1999 is the year of publication. This corresponds to an entry in my library.bib file that starts @article{smith_foo_1999. I use unite-bibtex and vim-pandoc, which both have great autocompletion for these keys, but what I'd really like to be able to do is to jump to my bibliographic entry in my library.bib file when I position the cursor over the key @smith_foo_1999, and press some key combination like gf or <C-]>. Is there a way to do that?

Jonathan
  • 2,139

1 Answers1

3

You could make a mapping in vim that opens the file, and searched for the selected word. Lets assume the following file structure:

.
..
img/
library.bib
markdownfile.md

a simple mapping could do most of the work then,

map <leader>bib yiw:e library.bib<CR>q/p

Place your cursor on the word, e.g. @mybib_2015 and press <leader>bib.

This mapping will

  1. yiw yank entire word
  2. :e library.bib<cr> open library.bib in a new buffer
  3. q/p will toggle search, and paste the aforementioned yanked word.