Wednesday, August 22, 2012

Re: Using Alt in my keymaps and utf-8



2012/8/22 Ben Fritz <fritzophrenic@gmail.com>
On Wednesday, August 22, 2012 9:28:47 AM UTC-5, pabl...@gmail.com wrote:
>
> As you can see in my first post I a mtryin to map <M-t> to <C-W>v,
> So Alt+t will make a vertical split.
> But looking at your mapping examples seems I am doing the map wrong.
>

Why do our examples indicate you're doing it wrong?

> Probably is because Vim sends the unicode keymao rather than the keymap I expect.
> What would be way to, let's say make my Alt-t keymap:
> nmap <M-t> <C-W>v

Looks like it should work to me. In fact, entering exactly that command into my gvim allows me to press ALT+t to open a new vertical split window, just as intended.

What happens if you open gvim with gvim -N -u NONE -i NONE and then execute your map command? Does it work then?
It works in gvim, but not in the terminal. I havetried gnome-terminal, mrxvt and xterm
In all of them when I press Alt-t with the previous mapping nothing happens.
I have tried to map the vertical split keymap to Alt-u, then I got a message saying that the buffer is Already at the oldest change.
So for the terminal seems that Alt-u is the same as pressing just u.

> But using unicode?

You should need absolutely zero knowledge of how Vim internally represents an ALT+t keystroke, nor how the keyboard sends it, in order to map it in gvim.

You can try using <Esc> as Chris suggests, but this should only work in some terminals, and it's a hack, not the "correct" solution. It WON'T work in gvim. I don't use the terminal enough to know off-hand what that "correct" solution is, but I'd get it working in gvim first and then figure out why it's not working in your terminal. See :help :map-alt-keys, which says (among many other things) that using the Alt keys in gvim "should always 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



--
Un saludo
Best Regards
Pablo Giménez

--
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