Bram Moolenaar wrote:
> Mark Lawrence wrote:
> > I'm running Linux, and have recently started using Vim. I typically run
> > vim 5.7 within an xterm. My problem concerns mapping with the Meta (Alt)
> > key. If I have the XTerm resource "eightBitInput" set to false, then my
> > Meta key mappings within vim don't work, presumably because xterm is
> > taking <M-key> and turning it into <Esc><key>. My solution for this is
> > to set the "eightBitInput" resource to true. Now my <M-key> mappings in
> > vim work fine.
> Well, if your xterm sends <Esc><key>, then that's what you have to map. If
> you map <M-key> and Vim receives <Esc><key> it obviously won't work. Vim's
> idea of <M-key> is that this is <key> with the 8th bit set. Vim doesn't know
> what the real effect of the Meta (Alt) key really is, since termcap/terminfo
> doesn't provide this information. And then you can change it with X
> resources. Actually, it's a mess, and the user has to find a solution...
Vim often makes the solution pretty easy. If you type <C-V><M-x> on
the command line, you often get the escape sequence sent my <M-x>. So try
:map <C-V><M-x> :echo "foo"<CR>
and see if that works.
HTH --Benji Fisher