4 ms·
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 (wh
by rav 6y ago
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!
- mdaniel 6y ago> 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-default-backspace-behavior https://stackoverflow.com/questions/18777705/vim-whats-the-d... One can see the current value of the backspace setting via <ESC>:echo &backspace
- rav 6y agoActually, 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.
- mdaniel 6y agoAh, 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
- rav 6y ago> they don't allow changing how many spaces pressing Tab while in Normal mode moves the cursor forward I'm pretty sure vanilla Vim doesn't do anything when pressing Tab in Normal mode - at least for me it certainly doesn't move the cursor.