Tuesday 15 September 2015

utf 8 - Vim: Geting out of insert mode. When I map alt-key combinations in insert mode, the character associated gets mapped, not the alt-key-combination -



utf 8 - Vim: Geting out of insert mode. When I map alt-key combinations in insert mode, the character associated gets mapped, not the alt-key-combination -

background: utilize alt-h j k l etc. out of insert mode. reason such thing explained here.

in xterm worked default, in gvim doesn't.

i guess can see life-threatening gravity of problem me, finding solution out of insert mode absolutely essential flow -- , thought found me... (edited formulation in response amandan...).

is there have gedit behave in "alt sends escape"-kind of way?

there might other solutions, seem pretty ugly:

my strategy tried mappings (w,e,d,c,r,a , whatever) instance alt-dw in insert mode me normal mode , delete word after cursor simple mappings like:

inoremap <m-d> <esc>ld inoremap <m-x> <esc>lx inoremap <m-x> <esc>lx inoremap <m-u> <esc>u inoremap <m-p> <esc>p

(the l before command corrects placement of cursor)

this works well, these mappings not map alt-key-combinations, caracters associated (in utf-8-encoding).

in above exemple:

ä, ø, Ø, õ, ð

the problem is, when tap ä exemple (i'm german, it's right on keyboard , need badly), vim out of insert mode , start "delete"-operation. meaning loose every possibility come in ä (or é, ê, ö, etc. of wich vital me).

is there way map alt-key-combinations , not caracter associated? (this question secondary. it's interesting inasmuch serves primary one: utilize alt-stuff out of insert mode)

other stuff tried or checked:

-- did

set termencoding=ascii

but didn't have effect (in gvim-gui - when run in terminal, has effect, it's not there need it).

-- enoding options set way before mappings not parsing problem.

-- tried

unmap <m-j> inoremap <m-j> <nop>

no effect.

vim utf-8 insert alt

No comments:

Post a Comment