πΎ Archived View for bbs.geminispace.org βΊ s βΊ vim βΊ 21413 captured on 2024-12-17 at 15:21:42. Gemini links have been rewritten to link to archived content
-=-=-=-=-=-=-
Re: "Always off by 1! Is it me?"
Yea, sort of makes sense, maybe. It sure drives me nuts!
I am constantly catching an extra character by yanking lines in V mode. To copy 2 lines I intuitively go down 2, and catch the first character of the next line! Combine that with pasting in the wrong place, and my next few minutes are occupied by furious remedial editing...
Nov 01 Β· 7 weeks ago
π¦ wasolili [...] Β· Nov 01 at 02:35:
for copying 2 lines, I usually just do `yj` which will yank the entire current line and the line after. numbers can be used for more lines, e.g. `y2j` for the current line and the next 2, and k works as expected (e.g yk for current line and the line above it)
then there's `yy` for just the current line. there's also the move and copy commands which are occasionally useful.
I very rarely use visual mode since usually the default motions behave more usefully outside of it. (as in `yj` from normal mode yanks the two lines, but `vyj` only yanks part of each line unless you do `0vj$y`))
I'd say the off-by-one thing is a UX bug. For me the main powerful idea behind Vi/Vim is not where the cursor ends up, but modes (normal/insert/visual). And the reason why modes matter is that typing becomes easy, because the user rarely has to press more than one key at a time on the keyboard. None of that Ctrl-Alt-Shift finger acrobatics.
π satch Β· Nov 01 at 13:32:
It would be pretty easy to make it the choice of the user whether to have the inconsistency be at the end of the line or the beginning of the line.
That way people who are bothered by the behavior could add something simple to their init script and problem solved.
That being said, itβs pretty easy to get used to - especially if you make frequent use of βAβ.
π stack [OP/mod] Β· Nov 01 at 16:28:
OK, I will make it a goal to find the bindings that actually do what I want and get used to them.
@arma - yes! Before Vim I spent almost a decade or so with Emacs and Common Lisp, and my hands are a wreck.
π¦ fiore Β· Nov 09 at 19:00:
happens to me as well!
Always off by 1! Is it me? β I love vim, but perhaps I am using it wrong! Whenever I do just about anything, I am pretty much always off by one character. In the simplest case, if I enter the instert mode and exit it, I am no longer on the same character! If I do it repeatedly, the cursor will crawl backwards. Whenever I yank and paste, I invariably wind up one character past where I wanted to paste. I thought I would get used to it eventually, but it's now been years and I am constantly '...
π¬ stack [mod] Β· 18 comments Β· 2 likes Β· Oct 30 Β· 7 weeks ago