Tuesday, August 21, 2012

Re: Using Alt in my keymaps and utf-8

On Sunday, August 19, 2012 6:35:03 PM UTC-5, pabl...@gmail.com wrote:
> Hello all.
> I am trying to do some keymappings to keys combinations which uses the Alt key.
> My problem is that, except for Alt-[Left|right|Up|Down] combination, any other combination I try like, Alt-= (M-=),
> Alt-t(M-t), etc ...
>
> Seems to be recognized as utf characters, so for instance <C-M-w> is recognized as <97> when I check my keymaps using the :map command.
> Similar thing happens to <M-t> which is recognized as an O with a hat symbol on it.
>
> So seems my Alt combination are mapped to utf characters rather than the real keyboard keys.
> I have been looking into google and seems vim always translates this combination of Alt keys to UTF characters.
> I understand that this is done while in insert mode, but why the map nmap command precessed <M-t> as an UTF character when I put something like:
>
> nmap <silent> <M-t> <C-W>v
> In my .vimrc?
> Is there  any reliable method to use Alt keymaps that works in both vim and gvim and for Linux and Mac?
>

Even though Vim sees the keys as a Unicode character, pressing the keys should still execute the mapping.

I don't think Vim can reliably do CTRL+Alt mappings, but I believe Alt-{key} mappings normally work fine.

Where do you encounter problems? Is it just terminal Vim, or also gvim? What happens when you press your ALT-t mapping? What did you expect to happen instead? What information led you to think it wouldn't work?

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment