Closed blueyed closed 9 years ago
No. That function must be called before InsertLeave
.
Do you want to use arrow keys in InsertMode? I will fix broken arrow keys problem in near future.
That function must be called before InsertLeave.
Yes, I've noticed that.
I've tried a bit using feedkeys
in InsertLeave
, but without success.
Do you want to use arrow keys in InsertMode?
The issue is not just about cursor keys, but any Escape/Alt-keys.
Another example is that I have mapped <A-[hjkl]>
in insert mode - Alt/meta also uses an escape sequence.
Can you tell me details. I tried
inoremap <A-a> foo
inoremap <M-a> foo
inoremap <Esc>a foo
but nothing happened.
inoremap <A-a> foo
works for me, but not in vim -u NONE -N
.
I use the following to set them up:
fun! MySetupAltMapping(c)
" XXX: causes problems in macros: <Esc>a gets mapped to á.
" Solution: use <C-c> / jk in macros.
exec "set <A-".a:c.">=\e".a:c
" XXX: Necessary?!
" exec "imap \e".a:c." <A-".a:c.">"
" insert and command line mode:
" exec "map! \e".a:c." <A-".a:c.">"
endfun
for [c, n] in items({'a':'z', 'A':'N', 'P':'Z', '0':'9'})
while 1
call MySetupAltMapping(c)
if c >= n
break
endif
let c = nr2char(1+char2nr(c))
endw
endfor
" for c in [',', '.', '-', 'ö', 'ä', '#', 'ü', '+', '<']
for c in [',', '.', '-', '#', '+', '<']
call MySetupAltMapping(c)
endfor
I've came across a (possibly relevant) setting: esckeys
. Maybe this can be used to tweak/fix the process somehow.
Because of the
<Esc>
mapping, special keys that use escape codes in the terminal are broken, e.g. cursor keys.While it can be disabled, it's meant to serve a purpose, I guess?!
Would using
InsertLeave
be an alternative here?