You should be able to get at the CodeMirror instance through the
CodeMirror property of the editor’s outer DOM node, and then get at the
CodeMirror class/constructor/module by taking the
constructor property from that. If you then load
vim.js, and its dependencies, making sure it gets the original CodeMirror module when it requests its
../lib/codemirror.js dependency, you should be able to set the keymap on the editor instance to vim.