I can create a simple textarea with vim mode. But I can not figure out how to integrate it with discourse editor. Please help me!
The below is the example code for producing the textarea with vim mode.
<!DOCTYPE html>
<html>
<head>
<title>Vim Mode Editor</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.58.3/codemirror.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.58.3/keymap/vim.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.58.3/codemirror.min.css">
</head>
<body>
<textarea id="editor"></textarea>
<script>
var editor = CodeMirror.fromTextArea(document.getElementById("editor"), {
lineNumbers: true,
mode: "javascript",
keyMap: "vim"
});
</script>
</body>
</html>
Thanks for any possible help!