jalvesaq / zotcite

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

Feature request: adding "data dir" for zotero on Windows 10 #25

Closed whytong closed 3 years ago

whytong commented 3 years ago

Currently for zotcite/vim in Ubuntu on WSL2/Windows 10, if the Zotero is a native Windows application, the "data dir" is not set by zotcite and the Zotero does not have a profile.ini file, such that when you press <Leader>zo, it points to a file under "/storage/..." which lacks the main data folder.

Adding the "data dir" seems to solve this issue and the attachment can be opened. A quick fix is to patch the python3/zotero.py file with the following:

233c233
<
---
>         self._dd = os.path.dirname(os.environ['ZoteroSQLpath'])

But I did not test on Linux, it may not be compatible.

Can the "data dir" be set automatically if the $ZoteroSQLpath is set?

jalvesaq commented 3 years ago

What about these lines at the end of the function _get_zotero_prefs (line 315 of python3/zotero.py)?

        # Workaround for Windows:
        if self._dd == '' and os.getenv('ZoteroSQLpath'):
            self._dd = os.path.dirname(os.environ['ZoteroSQLpath'])
whytong commented 3 years ago

Just tested. Yes, this works.

jalvesaq commented 3 years ago

Thanks for reporting the issue and for the feedback.