0

I happened to find that we may open 'Terminal windows' in Vim and am happy to stop using terminal app. (It's available in v8 and v9)

However, when I have a typing mistake, pressing Delete key does not go backward and rub it out. Instead, it produces a strange letter 'ÿ'.

The only way I can fix such mistakes is pressing Ctrl-H (but this is tedious).

I cannot find documentation addressing this issue.

I tried to remap but both failed:

  :tmap <ÿ> <c-h>

  :tmap <del> <c-h>

Any suggestion?

4
  • Thank @Rich for improving my wording. And the nice-looking way denoting a key is worth learning! Oct 6, 2022 at 9:31
  • You're welcome. I only edited it because your key presses <Delete> were invisible due to the way this site formats things. If you don't want to use the <kbd> notation, you need to surround things like that with backticks: `
    – Rich
    Oct 6, 2022 at 15:25
  • @Rich Thank you very much for your hint and suggestion! Now I learned the <kbd> markup - it's wonderful. The backticks used to mark a CODE piece up is also universally useful. (I used to write articles in Facebook. But since 10 years ago FB removed its limited markup ability (undocumented), I have not been aware that markup writing is so much well supported in other worlds!) Oct 10, 2022 at 4:52
  • You're welcome! There's loads more details about the supported markup available here.
    – Rich
    Oct 10, 2022 at 10:15

1 Answer 1

0

I've just got the answer from a colleague. The following mapping works:

:tmap <BS> <c-h>
3
  • Are you perhaps typing on a laptop, or other small keyboard? Generally these don't actually have a Delete key: the key you were likely pressing is called Backspace, which would explain why mapping <del> didn't work but <bs> does.
    – Rich
    Oct 6, 2022 at 15:29
  • Both my desktop and laptop were equipped with small keyboard. As far as I know, all Mac's keyboards have only <del> key and no <bs> key. (It's why I marked 'MacVim' at the title - it's a Vim port for Mac platform.) I have been working in Linux for 20 years. We used to buy desktops or laptops made for Windows. We always have the <bs> key above the <enter> key. There is also <del> somewhere else. Two years ago, I changed to adopt Mac as my working platform for some reason. I had hard time for 1 year to adapt myself to Mac - quite a lot was about the differences in keyboard. Oct 10, 2022 at 3:34
  • Looks like on a US keyboard, the key is labelled "delete", but it still functions as a backspace. To get <del> functionality you have to hold down fn while you press it. Try picking any of the other keyboards in the dropdown on the linked page: different label, same key.
    – Rich
    Oct 10, 2022 at 7:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.