1

My long term goal is to swap the ` and \ keys on my keyboard. Everything else is fine. I am calling vim with

vim -u NONE

Gives me these maps:

enter image description here

I do

:map ` \ 

and get

enter image description here

so the mapping has definitely taken.

However, when I type, or use a mark, the keys are exactly where they would be. I expect to be in a position where I can no longer type the ` key.

What's going on?

8
  • 1
    Based on the first line of the second window you escaped a space character in your mapping.
    – B Layer
    Commented Dec 17, 2020 at 9:50
  • @BLayer - that's a sensible point and I've fixed it in the example - I still find the mapping isn't doing anything (I also feel like if I'd escaped a space, I'd expect that all my ` would get replaced by spaces? or at least removed...)
    – Joe
    Commented Dec 17, 2020 at 10:40
  • It's unclear what exactly you expect this mapping will do... For example, it will not replace the backquote with a backslash in Insert mode, you would need an :inoremap to do that. What kind of command are you trying that is unexpectedly working? Double-backquote (to go to the last position after a jump)? Also, unclear what you intend that mapping to do, since backslash is typically a dead key that does nothing... You have no other mapping, so this is just disabling it?
    – filbranden
    Commented Dec 17, 2020 at 12:33
  • If you just want to swap the two keys in Normal mode (not in Insert mode), then you could use the 'langmap' option to do that. See :help 'langmap' for more details and instructions. (Let me know if that's what you want, I can write an answer for it.)
    – filbranden
    Commented Dec 17, 2020 at 12:35
  • Please don't post images of text
    – D. Ben Knoble
    Commented Dec 17, 2020 at 22:11

0

Browse other questions tagged or ask your own question.