Created
April 24, 2014 08:12
-
-
Save geecu/11246089 to your computer and use it in GitHub Desktop.
Enable vim mode for <textarea>s in a page
This file contains hidden or 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
// add our keyamp from github | |
var vimBinding = document.createElement('script'); | |
vimBinding.setAttribute('src', 'https://rawgit.com/jakub-m/vim-in-textarea/master/jsvim.js'); | |
// browser support for onload may be iffy ... | |
vimBinding.onload = function () { | |
var vim = new VIM(); | |
Array.prototype.forEach.call(document.querySelectorAll('textarea'), function (instance){ | |
vim.attach_to(instance); | |
}); | |
}; | |
document.body.appendChild(vimBinding); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment