Created
April 24, 2014 08:11
-
-
Save geecu/11246062 to your computer and use it in GitHub Desktop.
enable vim mode for jsbin editors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var vimBinding = document.createElement('script'); | |
vimBinding.setAttribute('src','https://raw.github.com/marijnh/CodeMirror/master/keymap/vim.js'); | |
var mirrors = document.querySelectorAll('.CodeMirror'); | |
// browser support for onload may be iffy ... | |
vimBinding.onload = function () { | |
Array.prototype.forEach.call(mirrors, function (instance){ | |
instance.CodeMirror.setOption('keyMap','vim'); | |
}); | |
}; | |
document.body.appendChild(vimBinding); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment