Can I use Vim to edit the notes in Zotero directly?

I am wondering if I can set Vim to be the default text editor for Zotero. Here goes the references:

- If one want to use TinyMCE, alexuw has provided a complete solution in this post: https://forums.zotero.org/discussion/8784/howto-enable-additional-tinymce-note-editor-functionality/

- If one happen to use Zotero on a Linux machine, then Johannes has written the following script to work with notes-managing through a Linux terminal: https://github.com/jbaiter/zotero-cli

However, what is missing are Windows and Mac users. And, ideally, notes taking and editing shall at best happen within the same interface.

Is there a way to change the Rich-text Notes Editor into a plain-text box? Vimperator has been doing great with plain-text intput-boxes; should the "text area" for notes be plain text, the connection from Zotero notes to Vim (the editor) will be successfully established.

I am also seeking help from the Vimperator community at the same time. Will post a solution if they can let enable Vim to edit those *Rich-text* "text area".

All the best,

-LL
  • It's possible. With 'gvim' instead of 'vim' it's easy and you just bind your mime-type to gvim. Make sure you have these configured:
    export EDITOR=vim
    export VISUAL=vim

    also

    xdg-mime default vim.desktop text/plain

  • @MrMvMan could you please be more precise? I am not that familiar with "mime-type" as you have mentioned. Is it a native function to Zotero? Or, is it a Linux specific setting?

    I have also looked up in the “about:config" for Zotero, but was not confident to identify an "Editor" entry and a "Visual" entry.

    For Zotero 5.0, I can only tell the editing panel is native to Zotero.

    Also, it seems that Zotero 5.0 now can let us add notes directly to the PDF file. Are we essentially writing to a some field native to the PDF file?

    All the bets,

    -Linfeng
  • Let's say you have markdown text or just plain text ~/Document/test.txt and you want to set some app (Try gvim, nvim, neovim and vim) open it.

    1. Query what is the mime name for desired file i.e. note?

    > xdg-mime query filetype ~/Documents/test.txt

    it give you this (for example):
    text/plain

    2. To find out the current app set for "text/plain"

    > xdg-mime query default text/plain

    Let's say the output is:
    gedit

    and now you want to set another app

    3. set default app for the mime-type

    > xdg-mime default gvim.desktop text/plain

    to test if applied successfully
    > xdg-open ~/Document/test.txt

  • Zotcli works on mac and will likely work on Windows.
  • I've confirmed that zotcli and vim work on Windows.
Sign In or Register to comment.