From 023cdd322a1c84ecba0e9b627561853cca88a668 Mon Sep 17 00:00:00 2001 From: Klaas Gunst Date: Fri, 26 Oct 2018 14:26:28 +0200 Subject: [PATCH] Multiple cites are put in one \cite{}. Correct bibtex ref If you select multiple papers at once, they are put in the same cite bracket (comma separated). "/" is substituted out of the id. Since this also happens for the bibtex refs. --- plugin/papis.vim | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/plugin/papis.vim b/plugin/papis.vim index 436f2a7..12aa5d6 100644 --- a/plugin/papis.vim +++ b/plugin/papis.vim @@ -26,14 +26,11 @@ function! s:handler(a) let candidates = [] for line in citations let id = matchlist(line, pat)[1] - call add(candidates, "\\cite{". id . "}") + call add(candidates, substitute(id, "/", "", "g")) endfor endif - for candidate in candidates - execute join([cmd, candidate]) - endfor - + execute "normal a\\cite{" . join(candidates, ", ") . "}\egql" endfunction