mlterm blocking Alt+I in vim-latex-suite

64 views
Skip to first unread message

zhengquan

unread,
Jan 2, 2009, 1:50:16 PM1/2/09
to vim_use
Dear vim users:
I found that using Alt-I to insert an \item does not work in mlterm.
xterm is ok. I wonder some mlterm features are blocking the alt-I
combo.

Thanks for any pointers and Happy new year.

Zhang

Tony Mechelynck

unread,
Jan 2, 2009, 2:26:11 PM1/2/09
to vim...@googlegroups.com

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

zhengquan

unread,
Jan 2, 2009, 5:05:16 PM1/2/09
to vim_use
Thanks Tony,
the output of the two verbose commands shows no mappings. 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.

Regards,
Zhang


On Jan 2, 1:26 pm, Tony Mechelynck <antoine.mechely...@gmail.com>
wrote:

Tony Mechelynck

unread,
Jan 2, 2009, 5:32:14 PM1/2/09
to vim...@googlegroups.com
On 02/01/09 23:05, zhengquan wrote:
> Thanks Tony,
> the output of the two verbose commands shows no mappings.

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.

zhengquan

unread,
Jan 2, 2009, 7:04:54 PM1/2/09
to vim_use


On Jan 2, 4:32 pm, Tony Mechelynck <antoine.mechely...@gmail.com>
wrote:
> On 02/01/09 23:05, zhengquan wrote:
>
> > Thanks Tony,
> > the output of the two verbose commands shows no mappings.
>
> You did issue them with your latex file current didn't you?
>
> What are you hoping that this Alt-I should do?

yes I did issue the commands with my latex file, and the output show
no mappings.
I am hoping that in an itemize environment, when I type alt-i in the
environment, it will automatically insert a \item

\begin
{itemize}
\item (\item is inserted as the result of alt-
i)

\end{itemize}

>
> > 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.
I know this a workaround but I would like to pass alt-i to vim in
mlterm. what I am doing now is that I am switching to some tasks to
xterm. but the support for multibyte characters of xterm is feeble.

>
> 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
this is confusing me because if I type alt-i in under mlterm with my
latex file, it will be a small-e-acute.
but if I use xterm, it will insert a correct \item. So this makes me
feel that the problem is with mlterm. It seems like an off topic issue
now...

Thank you for your help.

Regards,
Zhang

zhengquan

unread,
Jan 2, 2009, 7:05:04 PM1/2/09
to vim_use


On Jan 2, 4:32 pm, Tony Mechelynck <antoine.mechely...@gmail.com>
wrote:
> On 02/01/09 23:05, zhengquan wrote:
>
> > Thanks Tony,
> > the output of the two verbose commands shows no mappings.
>
> You did issue them with your latex file current didn't you?
>
> What are you hoping that this Alt-I should do?

yes I did issue the commands with my latex file, and the output show
no mappings.
I am hoping that in an itemize environment, when I type alt-i in the
environment, it will automatically insert a \item

\begin
{itemize}
\item (\item is inserted as the result of alt-
i)

\end{itemize}

>
> > 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.
I know this a workaround but I would like to pass alt-i to vim in
mlterm. what I am doing now is that I am switching to some tasks to
xterm. but the support for multibyte characters of xterm is feeble.

>
> 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
this is confusing me because if I type alt-i in under mlterm with my
latex file, it will be a small-e-acute.
but if I use xterm, it will insert a correct \item. So this makes me
feel that the problem is with mlterm. It seems like an off topic issue
now...

Thank you for your help.

Regards,
Zhang

Charles E. Campbell, Jr.

unread,
Jan 2, 2009, 8:12:19 PM1/2/09
to vim...@googlegroups.com
zhengquan wrote:
>
> On Jan 2, 4:32 pm, Tony Mechelynck <antoine.mechely...@gmail.com>
> wrote:
>
>> On 02/01/09 23:05, zhengquan wrote:
>>
>>
>>> Thanks Tony,
>>> the output of the two verbose commands shows no mappings.
>>>
>> You did issue them with your latex file current didn't you?
>>
>> What are you hoping that this Alt-I should do?
>>
>
> yes I did issue the commands with my latex file, and the output show
> no mappings.
> I am hoping that in an itemize environment, when I type alt-i in the
> environment, it will automatically insert a \item
>
> \begin
> {itemize}
> \item (\item is inserted as the result of alt-
> i)
>
> \end{itemize}
>
I suggest that you find out what's being delivered to vim when you press
Alt-i. What is being delivered is

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

zhengquan

unread,
Jan 11, 2009, 9:28:22 PM1/11/09
to vim_use
Hi Charles, I think we are close to the solution to the problem.

On Jan 2, 7:12 pm, "Charles E. Campbell, Jr."
I copied this code snippet to my .vimrc and tried in mlterm, but alt-i
still inserts a small e acute... in gvim alt-i inserts correctly,
Could you tell how can I debug the mappings?

Thank you very much, I am pretty headstrong and don't want to use
another mapping for the insertion.

Zhang

Tony Mechelynck

unread,
Jan 11, 2009, 10:10:49 PM1/11/09
to vim...@googlegroups.com
On 12/01/09 03:28, zhengquan wrote:
> Hi Charles, I think we are close to the solution to the problem.
>
> On Jan 2, 7:12 pm, "Charles E. Campbell, Jr."
> <drc...@campbellfamily.biz> wrote:
[...]

>> 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
>>
> I copied this code snippet to my .vimrc and tried in mlterm, but alt-i
> still inserts a small e acute... in gvim alt-i inserts correctly,
> Could you tell how can I debug the mappings?
>
> Thank you very much, I am pretty headstrong and don't want to use
> another mapping for the insertion.
>
> Zhang

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.

Reply all
Reply to author
Forward
0 new messages