Is the meta key supposed to do anything in vim? It would be nice if the things that can be done on the command line could also be done in insert mode (such as <M-t>
for transposing words). As it is (on my mac with iterm configured to use the command key as meta), it serves only as a quicker alternative to the escape key, because <meta+b>
= <esc>b
.
I found a post saying one could put
" fix meta-keys which generate <Esc>a .. <Esc>z
let c='a'
while c <= 'z'
exec "set <M-".toupper(c).">=\e".c
exec "imap \e".c." <M-".toupper(c).">"
let c = nr2char(1+char2nr(c))
endw
into .vimrc; but that only made my meta produce some useless symbols.
PS. I think the answer to this quæstion is simply no. Though it is useful for escaping to normal mode with the first command, <M-d>d
for <esc>dd
&c.
Cmd
asMeta
? Also, could you clarify what you mean when you say "It would be nice if the things that can be done on the command line could also be done in insert mode."? – romainl Sep 21 '15 at 11:35:set macmeta
? If this option is set you can map things like<M-a>
(Alt-a). – Andreas Sep 21 '15 at 14:41