Ionaru / Ionaru/easy-markdown-editor
How to set keyMap on codemirror editor to make use of other key bindings
- Dominant language
- JavaScript
- Stars
- 3.1k
- Forks
- 363
- PR merge metrics
- No merged PRs in 30d
Description
Is there a way to set a keyMap on the underlying codemirrior editor?
Example using sublime mapping https://codemirror.net/demo/sublime.html
- See how ctrl+d selects multiple items for multi cursor editing
- see how ctrl+shift+down moves a line down
- and a ton of other useful key shortcuts.
If you check the source of that demo, you'll see keymap is set at instantiation time...
```
var editor = CodeMirror(document.body.getElementsByTagName("article")[0], {
value: value,
lineNumbers: true,
mode: "javascript",
keyMap: "sublime",
autoCloseBrackets: true,
matchBrackets: true,
showCursorWhenSelecting: true,
theme: "monokai",
tabSize: 2
});
```
... other sources show you can also call CodeMirror.setOption with "keyMap" or [addKeyMap](https://codemirror.net/doc/manual.html#addKeyMap)
However, If I include `/keymap/sublime.js` in my html, I get an error due to `CodeMirror` not being exposed by `EasyMDE`
Thanks for any support or advice you can offer.
Contributor guide
Assessment
This issue has not been assessed yet.