vimperator-labs icon indicating copy to clipboard operation
vimperator-labs copied to clipboard

typing partial mapping in insert mode

Open ratijas opened this issue 9 years ago • 3 comments

Issue type:
  • Bug report
Version:
3.13.1 home-compiled
Description:

typing partial mapping while in INSERT mode differs from that of vim. vim actually inserts printed character into buffer (or makes it look like inserted) waiting for the next; then if mapping success it clears chars from buffer and executes mapping, otherwise it will timeout soon leaving chars in a buffer. on the other hand, vimperator won't ever timeout waiting until either mapping is complete or irrelevant character typed instead — latter will normally send all chars into buffer at once.

problem: can not type only beginning of the mapping as normal input, e.g. can not finish text with sequence that is part of map.

Steps to reproduce:
imap jk <Esc>
imap kj <Esc>

type k or j in any input field

ratijas avatar Jun 17 '16 20:06 ratijas

Able to reproduce.

As a possible workaround, I suggest using mappings with modifiers in insert mode. For example <C-j> (note: this is a default firefox keybind for going to about:home.

timss avatar Jun 20 '16 13:06 timss

yeah… but the point was that jk / kj is amazingly easy to hit in one keystroke without any modifiers.

ratijas avatar Jul 05 '16 12:07 ratijas

@ratijas We are the same. http://stackoverflow.com/questions/41234376/how-to-input-a-character-j-after-mapping-jj-to-esc-in-vimperator

ding3my avatar Jan 12 '17 11:01 ding3my