On Sunday, March 7, 2021 at 2:25:56 AM UTC+1 duhd...@gmail.com wrote:

> Hi All,
> I'm wondering if there is a way to enable meta key for vim on mac. I'm 
> using it from terminal. I read an earlier post in the mail list about 
> MavVim.app GUI. But I want to stick to the stock Vim. What I have found out 
> working:
>
> 1. NeoVim works with <M-x> out of the box. Of course you need to turn on 
> Meta emulation of your terminal.
> 2. Vim works with <M-n>-->˜ kind of mapping when turning meta emulation 
> off.
> 3. Vim works with <ESC>n kind of mapping when turning meta emulation on.
>
> So far, my best option seems to use <ESC>n types of mapping. But not sure 
> if this kind of mapping works with linux or not. Also for plugins using 
> Meta, I have to remap manually. I hope there are better options to have 
> Meta natively on Mac.
>
> Regards,
> Haodong Du
>

I suggest a two-step solution:

map <Esc>x <M-x>  " IMPORTANT: do not use :noremap here
map <M-x> whatever

This way, for all the mappings thus defined, Esc and Meta will  be 
interpreted the same way. You may also want to set timeouts as follows:
'timeout'   (boolean) on
'timeoutlen' (milliseconds) slower than your slowest typing speed for the 
{lhs} of a single mapping
'ttimeoutlen' (milliseconds) faster than your fastest typing speed but 
slower than the interval between successive bytes sent by the system for a 
single keypress.

Best regards,
Tony.

-- 
-- 
You received this message from the "vim_mac" 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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_mac+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_mac/e62a398b-d8d9-41df-883b-c491661d1347n%40googlegroups.com.

Reply via email to