marijnh/CodeMirror2 — pull request #266 by misfo (2011-11-30 00:22:14+00:00)
Title: Minimal set of Vim keybindings 

Here's a minimal set of Vim keybindings: basic char/line motions with counts, undo/redo with counts, and the basic insert switch. I plan to add more if you think this is a good start.

Certain other Vim commands, like word motions, don't behave the same as `CodeMirror.commands.goWordRight` and friends, so I left them out for now. Vim's "words" and "big words" aren't quite the same as CodeMirror's concept of a word so they'll need some extra code. In my opinion it's pretty important that often used commands like this behave as closely to Vim as possible.

One question I have: Is there a way to map keybindings based on the character that was typed rather than the key that was pressed? For instance, Vim maps `^` and `$` to go-to-first-non-blank-char and go-to-EOL, respectively. Mapping them in CodeMirror to `"Ctrl-6"` and `"Ctrl-4"` would work for US keyboards, but wouldn't be the right mapping for others.

Having a block cursor for the Vim mode would be great, too. It looks like the themes just set the border-left style for the cursor, so would all the themes have to be updated with block cursor styling in order for this to work?

Thanks for taking a look. The CodeMirror API seems pretty slick (and well documented!)