Giter Club home page Giter Club logo

Comments (6)

rafaqz avatar rafaqz commented on May 18, 2024

It would be great. My main use case is for editing and saving Zotero notes using the key to open a new buffer, but you could do the same for any field with the same code.

But there are two problems. Firstly sqlite dbs can only be accessed by one application at a time, and I often have zotero open when I work, and imagine many people do. The plugin currently copies the whole database to your temp directory so that it can open the copy while the main file is locked, so writing to it would achieve nothing unless you somehow know when to copy it back and are sure Zotero hasn't changed anything in the meantime (ie the ugliest of hacks - this plugin is already a hack, but at least a read-only hack). Second is Zotero has an api for saving data, but it is only for cloud data, not local data. at least at this stage. Basically whenever there is a sane way write local data I'll build it...

(Btw Unite just offers function hooks for supplying lists of strings (sources) and methods for acting on choices from them. This functionality wouldn't depend on those, just regular vimL.)

from citation.vim.

DancingQuanta avatar DancingQuanta commented on May 18, 2024

Would it be possible to detect if sqlite dbs is open with psutil where this module check if a file is opened by a process.
I am more interested in queueing edits to the db so that changes are made when possible but this code is a script not running program...

from citation.vim.

rafaqz avatar rafaqz commented on May 18, 2024

You could try something like that, but it would be an awful hack, that's really no what sqlite was designed to do and there are so many ways that will break. Better to wait for an api. Even better to help build the zotero local api.

from citation.vim.

DancingQuanta avatar DancingQuanta commented on May 18, 2024

Yes, a zotero local api would do. I don't know if LibZotero is a api though?
I wonder whether it is a good idea to close this issue, I feel that people may want to add their thoughts to this if it is visible.

from citation.vim.

rafaqz avatar rafaqz commented on May 18, 2024

Zotero as an api for web. Not for local. We need one for local.

Closed issues are searchable too.
Cheers

from citation.vim.

rafaqz avatar rafaqz commented on May 18, 2024

This turns out to already work pretty easily using zotcli, no code required! This will add a note for the key under the cursor:

nnoremap <silent><leader>cn :<C-u>UniteWithCursorWord -default-action=yank -force-immediately citation/title<cr><cr>:!zotcli add-note "<C-R>0"<cr>

from citation.vim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.