Coder Social home page Coder Social logo

risingorange / anki-external-editor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pointtonull/anki-external_editor

7.0 7.0 2.0 139 KB

Simple substitution of built in html editor with external tool

License: Apache License 2.0

Python 100.00%

anki-external-editor's People

Contributors

ijgnd avatar jack-faller avatar pointtonull avatar risingorange avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

andrea-berling

anki-external-editor's Issues

Simplify debugging/improve documentation

I found It quite hard to get this addon to work, for several interlocking reasons:

  • As with other keyboard shortcut addons, on mac Ctrl is actually Cmd, and Cmd does nothing.
  • Various editors may not work, presumably due to $PATH/config issues.
  • There is no information if calling the editor failed, or if the keyboard shortcut didn't even register.

Suggestions:

  • Mention the mac Cmd/Ctrl issue in the documentation/addon config window.
  • Throw an error (ideally in GUI form, e.g. one of those alert windows) if executing the command failed
  • Potentially allow specifying a custom environment file, "$PATH", or just mention that the program only reads from the default locations (if this is indeed so), and how that might interact with custom installs, e.g. via Homebrew.

Anecdotally, the addon did also not seem to work under 2.1.49, but since updating anki was one of the first steps I did when debugging, I can't be sure that it wasn't one of the above issues instead.

Just a few things that would clear up some of the confusion that also some of the other negative reviews seem to be suffering from. Thanks for developing the addon, and cheers! :)

Output is always processed as html. Please disable this.

Since the output is considered to be html, i need to use linebreaks
every time and other such things. I just want to quickly edit the field in normal way and let it show as it is in the anki field.

I tried changing the temporary file extension to "md" or "txt" but it still doesn't work and considers the text as html.

I figured out how to make vim and neo vim work

Just letting you know that terminal vim and neovim work with this add-on. All you have to do is add your terminal and vim or neovim to the add-on config. For eg: "terminal-name vim" or "terminal-name nvim".

Also, I've tried other text editors with this. Geany and gnome-text-editor also work with this add-on.

Setting Vim's filetype

I use another plugin along with External Editor that processes the field as Markdown instead of HTML. I thought I could set the filetype by configuring the external editor plugin like this:

{
    "editor": "vim -gf -c 'set filetype=markdown'",
    "shortcut": "Ctrl+Meta+X"
}

I've tried every variation of quotes and escaped quotes or spaces that I could think of, but I can't get the editor to open with a markdown filetype the way it does on the command line. Is there a way to do this with External Editor?

File not saving

I am on MacOs and I am having issues with the temporary file. I can open the edditor just fine and I can see what is already written, however, if I try to change it and then save, nothing changes in Anki. I used this addon on Linux and it worked perfectly fine so I am assuming it is a MacOS related issue.

Does anyone have any ideas how to debug this?

Compatibility with other versions of vim (pure vim or neo vim)?

Vim in my distro (Fedora) doesn't have an option for "vim -g". Also, since I use wayland, gvim behaves very glitchy and takes about a minute to start. The other text editors aren't as fast as I would like them to be. Can you please add support for neo-vim or just plain vim? I'm aware that simply putting them in the config causes input/output issues with vim

Add option to set extension of temporary files

Basically, my anki flashcards are actually markdown(-like) files, so I have to switch the language to md manually in vscode whenever I open a card to edit. This is but a minor hassle, and perhaps something I could solve in vscode itself, but I thought it might be nice if the addon included a function to pick the extension of the temporary files oneself. :)
This is a very niche use-case, so feel free to close this as wontfix it if you want!

Unable to open VS code on Windows 11

Here is my editor config for VS code, but its not opening VS Code. I have even tried full path, but still no VS Code window opens.

{
    "editor": "code -w",
    "file_extension": "html",
    "shortcut": "Ctrl+Alt+X"
}

However, if I restore to default, it opens notepad perfectly, with Ctrl + Alt + X

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.