You weren't kidding!
Inspect->Events->onClick
function() {
return window.print()
}
Though the codemirror stuff is probably a bit more work.