[vim] Incremental search

Added some handlers to dialog.js to enable key events callbacks that pass along the value of the input.

Vim will now perform incremental search: scrolling to and highlighting the search result as you type.

`Ctrl-C` and `Ctrl-[` will now exit prompts now that we have key handlers. https://github.com/marijnh/CodeMirror/issues/1076

I wanted to split up unrelated commits into separate pull requests. Let me know if you prefer just one big one.