Commands for using fzf-bibtex in Vim.
Install using your package manager - e.g. for
vim-plug, add
Plug 'rddunphy/vim-fzf-bibtex'
to your .vimrc.
Requirements:
Specify the a directory to use for the cache, and a colon-separated list of bibtex source files:
let $FZF_BIBTEX_CACHEDIR = 'path/to/cache/dir'
let $FZF_BIBTEX_SOURCES = 'paths/to/bibtex/files'
If $FZF_BIBTEX_CACHEDIR
is not specified, it defaults to
%APPDATA%\fzf-bibtex
on Windows, or $HOME/.cache/fzf-bibtex
elsewhere.
:FzfBibtex[!] [pre] [post] [sep]
- Use Fzf to select citations and insert
their keys as a comma-separated list. Optionally takes arguments for prefix,
postfix, and separators.:FzfPandoc[!]
- Insert Pandoc-style citation keys.:FzfLatex[!]
- Insert LaTeX-style citations with ~\cite{}
.:FzfMarkdown[!]
- Insert pretty-printed summaries of citations.Each command has a version with with the postfix Insert
(e.g.
:FzfBibtexInsert
), which returns to insert mode after inserting the
citations.
Appending an explamation mark to any command will open Fzf fullscreen.
By default, the following normal mode mappings are provided for LaTeX files:
<localleader>cc
→ ~\cite{keys}
<localleader>ct
→ \textcite{keys}
<localleader>cy
→ \citeyear{keys}
<localleader>ca
→ \citeauthor{keys}
<localleader>cs
→ \citeauthor*{keys}
<localleader>ck
→ comma-separated list of keys<localleader>cm
→ markdown summaryCorresponding insert mode mappings start with <C-Z>
:
<C-Z><C-Z>
or <C-Z>z
→ ~\cite{keys}
<C-Z><C-T>
or <C-Z>t
→ \textcite{keys}
<C-Z><C-Y>
or <C-Z>y
→ \citeyear{keys}
<C-Z><C-A>
or <C-Z>a
→ \citeauthor{keys}
<C-Z><C-S>
or <C-Z>s
→ \citeauthor*{keys}
<C-Z><C-K>
or <C-Z>k
→ comma-separated list of keys<C-Z><C-M>
or <C-Z>m
→ markdown summaryFor other file types, mappings are defined for markdown summaries and for Pandoc citation keys:
<localleader>cc
→ markdown summary<localleader>cp
→ pandoc keysCorresponding insert mode mappings start with <C-Z>
:
<C-Z><C-Z>
or <C-Z>z
→ markdown summary<C-Z><C-P>
or <C-Z>p
→ pandoc keysTo specify custom mappings, set 'g:fzf_bibtex_use_default_mappings'
to 0.