Lurker News

Comments (280) 72 threads

Show all comments

Showing thread 22 of 72

rav1 reply#
Nice trial exercise on the front page. While trying it out, I wanted to use the backspace key, which in Vim moves to the last character on the previous line (when used on the beginning of a line, that is), but that didn't work - backspace on the start of the line doesn't seem to move the cursor at all.

I was pleasantly surprised that cw and D are implemented correctly though, so props on that!

mdaniel1 reply#
> backspace on the start of the line doesn't seem to move the cursor at all.

AFAIK that's controlled by "set backspace=" and thus will vary based on one's .vimrc (or the system vimrc, installed by the package manager): https://stackoverflow.com/questions/18777705/vim-whats-the-d...
One can see the current value of the backspace setting via

    :echo &backspace
rav1 reply#
Actually, the 'backspace' setting only governs what the backspace key does in Insert mode. In Normal mode, which is what I was referring to in GP, has the behavior I describe regardless of how 'backspace' is configured.
mdaniel1 reply#
Ah, my apologies; I had never considered using backspace as a navigation operation. I would guess vim does not offer customization over what the backspace key does for the same reason they don't allow changing how many spaces pressing Tab while in Normal mode moves the cursor forward, either

I was inspired by this newfound "using unexpected keys for navigation" discovery and found that (at least in my vim 8.2) holding down space in Normal mode similarly travels across the EOL boundary, just as backspace reverses that trend, so at least it's consistent

Continue this thread — 1 reply