(function(){
window.VimArea = BotanJS.import( "Components.Vim.VimArea" );
var d = BotanJS.import( "Dandelion" );
var vimArea = d.id( "vim-area" );
vimArea.value = "Try pressing F10 here.";
var f10Binding = function ( e )
{
e = e || window.event;
if ( e.keyCode ) code = e.keyCode;
else if ( e.which ) code = e.which;
if ( code == 121 ) // F10, change this value to any key you like
{
e.preventDefault();
var node = document.activeElement;
if( node.nodeName == "TEXTAREA" )
{
new VimArea( node, true );
}
}
};
if(document.addEventListener) document.addEventListener('keydown', f10Binding, false);
else if(document.attachEvent) document.attachEvent('onkeydown', f10Binding);
else document.onkeydown = f10Binding;
})();