map Ctrl with special characters

65 views
Skip to first unread message

rameo

unread,
Apr 27, 2012, 11:45:15 AM4/27/12
to vim...@googlegroups.com
I still have problems mapping keys.

On my keyboard I have these keys I want to map:
<C-ò>
<C-à>
<C-è>
<C-ù>
<C-ì>

Tony once told in a message these info:
ò = (0xF2, o-grave) and <M-r> (Alt+0x72, Alt-r)
à = (0xE0, a-grave) and <M-`> (Alt+0x60, Alt-backtick)
è = (0xE8, e-grave) and <M-h> (Alt+0x68, Alt-h)
ù = (0xF9, u-grave) and <M-y> (Alt+0x79, Alt-y)
ì = (0xEC, i-grave) and <M-l> (Alt+0x6C, Alt-l)

But how to combine these letters to the Ctrl key?

Tony Mechelynck

unread,
Apr 27, 2012, 2:01:12 PM4/27/12
to vim...@googlegroups.com, rameo
On 27/04/12 17:45, rameo wrote:
> I still have problems mapping keys.
>
> On my keyboard I have these keys I want to map:
> <C-�>
> <C-�>
> <C-�>
> <C-�>
> <C-�>
>
> Tony once told in a message these info:
> � = (0xF2, o-grave) and <M-r> (Alt+0x72, Alt-r)
> � = (0xE0, a-grave) and <M-`> (Alt+0x60, Alt-backtick)
> � = (0xE8, e-grave) and <M-h> (Alt+0x68, Alt-h)
> � = (0xF9, u-grave) and <M-y> (Alt+0x79, Alt-y)
> � = (0xEC, i-grave) and <M-l> (Alt+0x6C, Alt-l)
>
> But how to combine these letters to the Ctrl key?
>


I'm not sure you can.

Try hitting Ctrl-K in Insert mode, followed by the desired key
combination, and see if anything appears. If yes, it is the <> form of
whatever Vim sees.

Or try hitting Ctrl-V in Insert mode followed by the key combination.
Vim will tell you what (if anything) it gets from the keyboard. For
instance if you hit Ctrl-V Ctrl-� and Vim inserts � it means that it
can't tell the difference between � and Ctrl-�. If you hit Ctrl-V Ctrl-�
and Vim doesn't insert anything (and, if 'showcmd' is on, you see that
^V doesn't disappear near the bottom right corner of the Vim screen),
then Vim hasn't got anything from the keyboard interface for your Ctrl-�
combo.


Best regards,
Tony.
--
The years of peak mental activity are undoubtedly between the ages of
four and eighteen. At four we know all the questions, at eighteen all
the answers.

rameo

unread,
Apr 28, 2012, 3:39:45 AM4/28/12
to vim...@googlegroups.com
When I hit Ctrl-K in insert mode followed by Ctrl-ò nothing happened.
When I hit Ctrl-Q (I have the gvim win version) in insert mode followed by Ctrl-ò again nothing happened.

Yes ^V (+ ^K) doesn't disappear near the bottom right corner of the Vim screen as you've indicated.

Does this mean that I can't map these keys with Ctrl?
I had to use C-Q.

Ben Fritz

unread,
Apr 30, 2012, 10:42:49 AM4/30/12
to vim...@googlegroups.com
Yes, as Tony said, if you press CTRL-V/CTRL-Q in insert mode, followed by your key combination, and nothing happens, then Vim does not even get the key sequence and you cannot map it.
Reply all
Reply to author
Forward
0 new messages