kana / vim-submode

Vim plugin: Create your own submodes
http://www.vim.org/scripts/script.php?script_id=2467
217 stars 24 forks source link

undocumented limitation: length of mappings on LHS #2

Closed morefun2compute closed 10 years ago

morefun2compute commented 12 years ago

I don't know exactly what the problem is, but when I call submode#enter_with, I can use "xxx" as the LHS of the mapping but not "xxxx" or any longer mapping. The limitation doesn't really bother me, but the error message is simply "line 16: invalid argument" with no indication of which script/function had an error, so it took me a while to figure out what was happening.

morefun2compute commented 12 years ago

Oops. The GitHub markdown caught me off-guard. The examples that I meant to write were: <plug>xxx and <plug>xxxx

kana commented 12 years ago

I don't set any limit about length. And it's odd for me to use <Plug> as a lhs to submode#enter_with. Wouldn't you mind giving me a complete example to reproduce the problem?

kana commented 10 years ago

Submode key mappings are built on top of normal key mappings. And normal key mappings have a limitation: the maximum length of LHS is 50.

Submode key mappings are prefixed with special characters (like <Plug>(submode-prefix:foo)) to distinguish from normal key mappings. So that the maximum length of submode LHS is shorter than the one of normal key mappings.

The actual LHSes of submode key mappings include submode names. So that available space is varied on each key mapping. I think 10 or more characters are usually available.

I'll add a note on the document.