0

I've recently installed "huge" VIM 8.1 with Lua support (on macOS via MacPorts). This installation is side-by-side with my "normal" VIM 8.0 which lacks Lua support, so I have access to both versions. The <DELETE> key behaves differently in "huge" VIM 8.1 than it does in "normal" VIM 8.0.

Say I have the phrase GIVE REASON HERE and I want to cut/move the word REASON I would fR then v then fH then <DELETE> (to backspace over the "H" and remove it from the selection) then x to cut the word REASON (Yes; there are different ways to do this. This is a contrived example to illustrate the issue I need to resolve.)

In "normal" VIM 8.0, this works fine. In "huge" VIM 8.1, when I hit the <DELETE> key to backspace over the "H", it instead deletes the word REASON. I read many online posts about how to fix this, quite a few of them were contradictory. These ranged from using stty, mapping/unmapping keybinds, using set backspace, and so on. I tried them all - in both their "do this" and "don't do this" configurations - and not a single one helped.

I want <DELETE> in VIM 8.1 to behave the same as it does in VIM 8.0; how do I do this?

  • Have a look at the faq – Christian Brabandt Apr 17 at 16:26
  • I'm trying to understand why VIM 8.0 and VIM 8.1 are sufficiently different that keystrokes behave differently when there is no other difference in the environment. I can find no mention of mapping differences between 8.0 and 8.1 in the documentation. Nor can I find a anything to indicate a difference when reviewing the list of changes between 8.0 and 8.1. I've read the FAQ; I'm not trying to create or modify a mapping. If I need to change a mapping, there's been no explanation as to why. – LiamF Apr 17 at 20:06
  • Well, why the faq talks about how to map a key, the principle is still the same. First find out what keys is actually seen by vim. Then we can have a look at how to fix this. Also note, you did not mention, whether you did run this in a terminal or in a gui and what exact version you used. Also $TERM might make a difference, if using terminal vim. So still missing quite a bit of information. – Christian Brabandt Apr 17 at 20:10
  • macOS (various; 10.11 through 10.14); iTerm2 3.2.8; bash 3.2, bash 4.2; VIM 8.0.1283, VIM 8.1.577; $TERM=screen-256color, $TERM=xterm-256color, $TERM=xterm; My keyboard emits 0x08 for ^H, 0x7F for <DELETE>, and 0x08 for fn-<DELETE>; vmap <BS> reports No mapping found; vmap <Del> reports No mapping found – LiamF Apr 17 at 21:25
  • Not to be rude, but I don't see how/why any of that matters. Literally, the only thing that changed was moving from VIM 8.0 to 8.1. Version 8.1 is doing something differently; it's not my environment. This point is driven home by the fact that I can run both versions of VIM side-by-side and experience the different behavior live. – LiamF Apr 17 at 21:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.