1 0
Contact Author Sign in to rate

Custom editor keymap

<10kB. Updated 2021-10-14. Only supports Anki 2.1.x.
The author has shared 8 other item(s).

Description

It has been pointed out to me that equivalent functionality is already available through https://ankiweb.net/shared/info/1899278645 and https://ankiweb.net/shared/info/396502676 so this addon is superfluous. Oh well, it is here now and functioning as far as I can tell, Use at your own peril. Allows customizing the editor keymap, i.e. what character(s) are inserted on the press of a specific key and modifiers. Example: configure ArrowRight+Alt to insert "→" symbol. Sample config content { "<nop>": "", "ArrowRight+Alt": "→", "ArrowRight+Alt+Shift": "⇒", "ArrowLeft+Alt": "←", "ArrowLeft+Alt+Shift": "⇐", "ArrowUp+Alt": "↑", "ArrowUp+Alt+Shift": "⇑", "ArrowDown+Alt": "↓", "ArrowDown+Alt+Shift": "⇓", "ArrowLeft+Ctrl+Alt+Shift": "↔", "ArrowRight+Ctrl+Alt+Shift": "⇔", "F7+CMD": "var t = document.activeElement.shadowRoot.innerHTML.match(/(?<={{c)\\\\d+(?=::)/g) || [\"0\"]; wrap(\"{{c\" + (Math.max.apply(null, t.map(i=>Number(i))) + 1) + \"::\", \"}}\");", "X+Ctrl+Shift+Alt+CMD": "var els = document.activeElement.shadowRoot.querySelectorAll(\"div, p, span\"); els.forEach(el => { if(!el.hasAttributes()) { var par = el.parentNode; while (el.firstChild) par.insertBefore(el.firstChild, el); par.removeChild(el); } });" } CHANGELOG

Download

As add-ons are programs downloaded from the internet, they are potentially malicious. You should only download add-ons you trust.

Supported Anki versions:

To download this add-on, please copy and paste the following code into Anki 2.1:

617159433

If you were linked to this page from the internet, please open Anki on your computer, go to the Tools menu and then Add-ons>Browse & Install to paste in the code.

All Anki 2.1.x Add-Ons Contact Author

Reviews

on 1633618736
Great add-on!