jalvesaq / zotcite

Neovim plugin for integration with Zotero
GNU General Public License v3.0
159 stars 13 forks source link

zotcite#GlobalInit not called automatically #40

Closed ryan-heslin closed 2 years ago

ryan-heslin commented 2 years ago

After updating to the latest plugin version, I tried to use the Znote command to insert a Zotero note, but this triggered a "command not found" error. Running Zinfo returned only a message that I was a using a different omnifunc than the plugin expected (as expected, since I had a language server attached). Thinking a language server was causing the issue, I tried running vim with a minimal configuration file containing only:

call plug#begin(stdpath('data') . '/plugged')
    Plug 'jalvesaq/zotcite'
call plug#end()

but I received the same "command not found" error. Then I scanned the plugin'szotcite.vim file and ran call zotcite#GlobalInit(), which fixed the issue. I hadn't used the plugin for several months, but if I remember correctly, the version I used then had all commands enabled at startup. I'm not sure if this behavior is intended, so I raise this issue purely because I couldn't find a statement in the documentation that the user should call zotcite#GlobalInit() manually. If it is intended, I think it should be noted in the documentation.

jalvesaq commented 2 years ago

Zotcite's initialization is aborted if the field "bibliography" is present in the YAML header. Otherwise, it should work if the 'filetype' is "markdown", "pandoc" or "rmd".

ryan-heslin commented 2 years ago

I'm sorry. I completely forgot the plugin was intended to work only for those filetypes. I checked, and everything works correctly for files of those types. So there's no issue.