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?
Asked
Active
Viewed 246 times
1
Jonathan
- 2,139
1 Answers
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
yiwyank entire word:e library.bib<cr>open library.bib in a new bufferq/pwill toggle search, and paste the aforementioned yanked word.