lambdalisue / jupyter-vim-binding

Jupyter meets Vim. Vimmer will fall in love.
2.1k stars 136 forks source link

jk -> Esc does not mix well with "." (repeat last command) #72

Closed ghost closed 8 years ago

ghost commented 8 years ago

Environment

Ubuntu Google Chrome Current version

I have the following binding in my custom.js:

CodeMirror.Vim.map("jk", "<Esc>", "insert");

The behavior works correctly for mapping "jk" -> Esc. However, the behavior of "." (i.e. repeat last command) for a command that ended by using "jk" in place of Esc is incorrect. It has the effect of inserting an extra j after each command. For example, in a new notebook, the sequence of keystrokes.

iajk.

Will produce:

aja

Rather than:

aa

This causes problems for anyone who uses both jk -> Esc or jj -> Esc and also uses the "." (repeat last command).

lambdalisue commented 8 years ago

Hum... It seems a limitation of CodeMirror's Vim mode. You probably need to make an issue on CodeMirror's repository.

ghost commented 8 years ago

Okay, thanks for looking into it! Don't think I care enough to bother further but yea, it doesn't really work.