msprev / fzf-bibtex

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

Remove @-character from citations #21

Closed NicolaiRuckel closed 4 years ago

NicolaiRuckel commented 4 years ago

I use @ashwinvis's code from the Vim integration section but bibtex-ls always prefixes my citation keys with an @. This means when I type \cite{@@ and then choose the correct reference I get \cite{@citation-key} and have to change it to \cite{citation-key} every time. Is there a way to do this automatically?

NicolaiRuckel commented 4 years ago

I realized there is already a pull request that added this functionality with bibtex-cite's -prefix flag.

msprev commented 4 years ago

Absolutely, this has already been implemented in the latest version.

You need to customise your citation format by adding parameters to your call to bibtex-cite.

    let r=system('bibtex-cite -prefix="\cite{" -postfix="}" -separator=", " ', a:lines)

Make sure you pull and compile the latest version before trying this.