Alt-I is not a standard Vim binding. You might try to see how it is
defined and by what:
:verbose map <M-I>
:verbose map! <M-I>
(both with and without the exclamation mark, and while editing the file
where you expected to use the Alt-I combo, not while looking at the
help). Then you may remap the same {rhs} to a different {lhs} which Vim
is more likely to see in all terminals, e.g. F7 which is about
vertically above the I on a QWERTY, QWERTZ or AZERTY keyboard.
Or you can even take advantage of the fact that mappings defined without
"nore-" will reinterpret their {rhs} for further mappings:
:map <F7> <M-I>
:map! <F7> <M-I>
(Some terminals and some window managers don't pass all key combos to
programs running in them. Also, Alt-letter combinations are usually
mapped to menus, and your mlterm might just have a menu starting in I.)
Best regards,
Tony.
--
Democracy is a form of government in which it is permitted to wonder
aloud what the country could do under first-class management.
-- Senator Soaper
You did issue them with your latex file current didn't you?
What are you hoping that this Alt-I should do?
> It is quite
> possible that the mlterm does not pass the alt-i combo to vim... I am
> wondering how to make alt-i passable to vim in mlterm.
As I said, if I were you I'd use a different key. You can even map F7
(or anything that Vim does see) to Alt-I and from then on when you hit
F7 Vim will interpret it as Alt-I.
Note that Vim cannot distinguish Alt-i from é (small-e-acute), or Alt-I
(Alt-Shift-i) from É (capital-E-acute). If you can type é (e.g. as e2 in
pinyin), Vim will see it as synonymous to Alt-i. This also means that
you should not map Alt-i in Insert mode if you want to be able to type
e-acute into your text.
>
> Regards,
> Zhang
Best regards,
Tony.
--
Old soldiers never die. Young ones do.
a) likely to be different between vim and gvim
b) likely not to be what vim/gvim thinks <m-i> is
I constructed the following two maps by pressing ctrl-v and then alt-i
after typing "nmap ". They "work for me"; that's not to say that the
email won't mutilate it nor that your terminal interface will deliver
the same thing in vim's case.
if has("gui_running")
nmap é :echo "gvim's alt-i"<cr>
else
nmap i :echo "vim's alt-i"<cr>
endif
Of course, you can modify the maps' payload to suit your needs.
Regards,
Chip Campbell
Small e-acute is the value internally used by Vim to represent Alt-i.
If, without any mappings, Ctrl-V Alt-i inserts the same é for you on
both gvim and Console Vim, it means it is recognized correctly.
You could try
:nmap <M-i> :echo 'Alt-i'<CR>
If it works (in Normal mode), Vim sees alt-i correctly. However, it is
never able to distinguish between Alt-i and small-é-acute, which means
you should avoid using Alt-i for an Insert-mode {lhs} if you use
languages like French, Spanish or Hungarian (all of which make heavy use
of that letter), Chinese pinyin with tone marks, or even the English
language with loanwords like /risqué jokes/ or /rosé wine/.
I notice (by the Ctrl-V prefix trick) that on my system, Alt-i generates
Esc i in Console Vim in both the KDE konsole and the Linux terminal. So
I might use
:if has('gui_running')
: nmap <M-i> :echo "gvim's Alt-i"<CR>
:else
: nmap <Esc>i :echo "vim's Alt-i"<CR>
:endif
or even
:nmap <M-i> :echo "gvim's Alt-i"<CR>
:nmap <Esc>i :echo "vim's Alt-i"<CR>
for a test similar to Dr. Chip's.
Best regards,
Tony.
--
No letters of the alphabet were harmed in the creation of this message.