msprev / fzf-bibtex

a BibTeX source for fzf
BSD 3-Clause "New" or "Revised" License
129 stars 15 forks source link

bibtex-* commands not exported #9

Closed dloewenstein closed 5 years ago

dloewenstein commented 5 years ago

Thank you for awesome work!

Just one thing, I followed the installation instructions (I'm running ubuntu 18.04 under WSL) but the go command where not exported. Had to add make the following changes to vimrc to make them work

let $FZF_BIBTEX_CACHEDIR = 'PATH-TO-CACHE-DIR' let $FZF_BIBTEX_SOURCES = 'PATH-TO-BIBTEX-FILE'

function! s:bibtex_cite_sink(lines) let r=system("~/go/bin/bibtex-cite ", a:lines) "inserted filepath execute ':normal! i' . r endfunction

function! s:bibtex_markdown_sink(lines) let r=system("~/go/bin/bibtex-markdown ", a:lines) "inserted filepath execute ':normal! i' . r endfunction

nnoremap c :call fzf#run({ \ 'source': '~/go/bin/bibtex-ls', "inserted filepath \ 'sink*': function('bibtex_cite_sink'), \ 'up': '40%', \ 'options': '--ansi --layout=reverse-list --multi --prompt "Cite> "'})

nnoremap m :call fzf#run({ \ 'source': '~/go/bin/bibtex-ls', "inserted filepath \ 'sink*': function('bibtex_markdown_sink'), \ 'up': '40%', \ 'options': '--ansi --layout=reverse-list --multi --prompt "Markdown> "'})

msprev commented 5 years ago

Thanks -- this looks like the relevant commands were not in the system file path in your case... I'll modify the docs to highlight this possibility.