Nvim-R icon indicating copy to clipboard operation
Nvim-R copied to clipboard

`let R_assign_map = '<M-->'` does not work to me

Open iagogv3 opened this issue 4 years ago • 3 comments

Following the documentation, I have added

set <M-->=^[-
let R_assign_map = '<M-->'

to ~/.vimrc in order to use Alt-- to insert <- but it is not working (it just avoids replacing _ by <-). It places the cursor at the beginning of one line up. I looked for

:verbose map ^[-

to see if it was used for another plugin, but I get No mapping found. Which can be the issue?

Thanks!

iagogv3 avatar Nov 18 '21 10:11 iagogv3

A can replicate the issue. If I do the trick taught at stackexchange (answer 69), I find - as the final string of <M-->. However, without, any trick, that is, without using the sed -n l command, if I hold the left Alt key and press = in Insert mode, I get ½. So, I put in my init.vim:

let R_assign_map = '½'

and now I can press Alt= to get " <- ". I was still using the default underscore as R_assign_map, but I liked so much the <M-=> that now I switched to it.

Maybe someone else can find a way of mapping <M-->...

Thanks for reporting the issue!

jalvesaq avatar Nov 18 '21 11:11 jalvesaq

@jalvesaq:

... if I hold the left Alt key and press = in Insert mode, I get ½.

If I do the same, I am taken to normal mode (neovim 0.4.4, us layout).

mschilli87 avatar Nov 19 '21 07:11 mschilli87

My keyboard has the Brazilian layout. The keys are mostly in the same position as in the U.S. keyboard, but it seems that we have more variation in the output of Alt keys.

jalvesaq avatar Nov 19 '21 21:11 jalvesaq

I'm closing the issue because the problem is fixed in Neovim: let R_assign_map = '<M-->' works as expected. I don't know when it was fixed... I'm using Neovim v0.9.0-dev.

jalvesaq avatar Nov 01 '22 01:11 jalvesaq

Not working yet with ViM 8.2 on Debian stable (https://packages.debian.org/bullseye/source/vim) :(

iagogv3 avatar Nov 02 '22 16:11 iagogv3

It does not work with Vim, only with GVim and Neovim. But it is a limitation of Vim, not Nvim-R.

jalvesaq avatar Nov 02 '22 18:11 jalvesaq

Do you mean this will not work even with future versions of ViM?

iagogv3 avatar Nov 03 '22 06:11 iagogv3

I don't know because I'm not part of Vim's development team, but similar issues have already been reported: https://github.com/vim/vim/issues?q=is%3Aissue+is%3Aopen+map+alt+key+

jalvesaq avatar Nov 03 '22 11:11 jalvesaq