What it boils down to is that Vim always wants to display the beginning of any line the cursor is on. If you have a very long line which wraps many times (as is common in writing prose, since Vim treats such "paragraphs" as single lines) and the beginning of the line is off the screen to the top, the display will jump as soon as you put the cursor into that line (eg by jk'ing up from below) as Vim brings the entire line into view. I don't think recording more videos will help, since the one I posted shows everything you need to know to understand the problem.
Let me show you this way: ------------top------------ This is the FIRST paragraph of this text. It is actually one single line from Vim's perspective, but since it's prose, it's several sentences forming a paragraph. █ This is the SECOND paragraph of this text. It is actually one single line from Vim's perspective, but since it's prose, it's several sentences forming a paragraph. This is the THIRD paragraph of this text. It is actually one single line from Vim's perspective, but ---------bottom------------ Fig. 1 - Screen State 1 Let's assume that I scroll the screen down from Screen State 1 to Screen State 2: ------------top------------ from Vim's perspective, but since it's prose, it's several sentences forming a paragraph. This is the SECOND paragraph of this text. It is actually one single line from Vim's perspective, but since it's prose, it's several sentences forming a paragraph. This is the THIRD paragraph of this text. It is actually one single line from Vim's perspective, but since it's prose, it's several sentences forming a paragraph. █ ---------bottom------------ Fig. 2 - Screen State 2 As you can see, I've scrolled down by three lines. From Vim's perspective, it isn't three "lines," it's just the first section of the first line that has scrolled up off the screen. Remember, Vim has a desire to display the beginning of the line the cursor is on that's so strong that only a heroine addict could understand, so when I move the cursor back up to the first paragraph, instead of display Screen State 3 or 4 (see below), it will jerkily jump the display up to Screen State 1 (see above). ------------top------------ actually one single line from Vim's perspective, but since it's prose, it's several sentences forming a paragraph. █ This is the SECOND paragraph of this text. It is actually one single line from Vim's perspective, but since it's prose, it's several sentences forming a paragraph. This is the THIRD paragraph of this text. It is actually one single line from Vim's perspective, but since it's prose, it's several sentences forming ---------bottom------------ Fig. 3 - Screen State 3 ------------top------------ of this text. It is actually one single line from Vim's perspective, but since it's prose, it's several sentences forming a paragraph. █ This is the SECOND paragraph of this text. It is actually one single line from Vim's perspective, but since it's prose, it's several sentences forming a paragraph. This is the THIRD paragraph of this text. It is actually one single line from Vim's perspective, but since it's prose, it's ---------bottom------------ Fig. 4 - Screen State 4 In other words, Vim will not simply move the display up line by line. It will jump up by however many lines it takes to get the beginning of what it sees as a line onto the screen. Again, the behavior I'm suggesting Vim use is the behavior found *by default* in Emacs, Windows Word, every single browser, VSCode, every single e-reader when set to scroll mode, etc., etc. I understand that not a lot of people use Vim the way I do, and when writing code, lines should never go beyond 80 characters anyway, so it doesn't matter when writing code, but the question does arise: why is Vim (and only Vim) this way? It's a mystery. Another question: why don't I just use those other editors? Because I've tried them all, and Vim is the best. This bizarre quirk in Vim not a deal-breaker, but it is irritating, especially since there doesn't seem to be a reason for it to exist (since no other editor has it). Anyway, I hope you now understand the issue I'm describing. Let me know if you have any other questions. Marc Adler On Sunday, October 26, 2025 at 3:35:59 PM UTC-5 Christian Brabandt wrote: > > On Di, 21 Okt 2025, Marc Adler wrote: > > > Imgur appears to be down so I've uploaded the video to one of my unused > websites. > > > > https://www.texasmidnight.com > > > > At the very beginning I do :echo winheight(0) winwidth(0) at the bottom > so you can see the size. > > > > Then I "scroll" up and down using j and k (which I've remapped to gj and > gk) just to show how the display jumps between paragraphs. > > > > Then I use ctl-e/y to scroll that way. Then you can see my cursor (the > one operated by my mouse) move to a paragraph at the top which is only > partly displayed. When I click in > > there in order to move the Vim cursor into that position, the display > jumps again to display the whole paragraph. > > > > This behavior is being caused by Vim's desire to bring the beginning of > any line where the cursor is into the display window. > > > > Let me know if you have any questions. > > There was a reason I asked for a reproducible example starting with vim > --clean > > I find it hard to follow what exactly you did, but it does not seem to > be related (directly) to smooth scrolling but rather to using the mouse > to position the cursor? > > Thanks, > Christian > -- > There is no hunting like the hunting of man, and those who have hunted > armed men long enough and liked it, never care for anything else > thereafter. > -- Ernest Hemingway > -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/vim_dev/123485ca-131c-4a22-a4df-09dbdb40785dn%40googlegroups.com.
