-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support for zotero #14
Comments
I've been thinking about this, and we could make it so adding something like "@zotero" to g:pandoc_bibfiles would make completion use zotero as a source (the same could be done with the citekeys dictionary, btw). |
Zotero support has to remain mothballed at the moment, since they say they are working on improving the API, and right now there is no reliable way to get the database out in a format the citeproc-hs can process. (There is a neat project, zotero-plain, that aims to provide support for zotero + citeproc-js in RST documents.) Eventually, Zotero support will require (when using local zotero) a user supplied directory to a zotero folder. That could be done via something like "@zotero:/path/to/zotero/data" in g:pandoc_bibfiles, I suppose. Using the zotero.org server will require some other settings. |
This would be a very nice feature to have. In the meantime I share my manual procedure in case someone finds it useful:
grep '@[a-z]*{.*,' zotero.bib | sed 's/@.*{\(.*\),/\1/g' > zotero.dict
" bibtex keys
set dictionary=$HOME/.citations/zotero.dict
" also scan dictionary files
set complete=.,w,b,u,t,k,i
" add dash and underscore as letter of words in dictionaries
set iskeyword=@,48-57,-,_,*,:,192-255 |
Thanks for the tip. If you put the dict file (or a symlink to the dict file) at
then vim-pandoc will add it to your dictionary automatically, and you can use it with dictionary completion (CTRL-X CTRL-K). But we don't set iskeyword. Maybe we should? But if you are using vim-pandoc, you can just use the bibtex file directly, rather than harvesting the keys into a dict file. Either put the exported bibtex file somewhere the bundle can find it (
Then, instead of dictionary completion, use omnicompletion (CTRL-X CTRL-O), and we've got a completion function that will search through the bibtex file, returning a popup with citekey, author - title. If you have bibtool installed, you can
and the completion function will search for matching author and title, not just citekey...
|
Some progress on this front. According to this post, the API now supports getting citeproc JSON. So it should just be a matter of scanning the file for citekeys, asking Zotero to provide a citeproc JSON bibliography for those entries, and passing that on to pandoc. But it may be that zotero-plain will implement a robust solution that we can piggy-back on. |
Any news regarding this one? Or a vim-zotero plugin? This would be great.. |
It would be great, indeed. I've started a topic on Zotero forums on suport for plain text files... But no one manifested a will to develop such a tool... |
I think now a separate plugin is best. However, we should provide ways to hook it (and other possible bibliographic sources) with our auto completion functionality. I'll be out of reach for the next two weeks, but I'll be thinking about this. |
I've started a "zotero" branch. So far, it implements citekey completion from zotero, relying on pygnotero. This remains half-baked, because there is currently no easy way to get zotero to provide a bibliographical database containing these citekeys in any of the formats supported by citeproc-hs.
So real support will have to wait until the zotero apis are improved. But ultimately, I'd like to support completion both from a local zotero database and from zotero.org, and sucking the database both from a local zotero instance and from zotero.org.
The text was updated successfully, but these errors were encountered: