Friday, October 10, 2025

Re: Scrolling behavior when using gj and gk is jumpy

I don't think the issue is asymmetric as you claimed? gj/gk exhibits
the same jumping behavior both up and down (which is also shown in
your video). When you go to a new line, Vim tries to fit the entire
wrapped line with the cursor in the whole screen which is why it feels
jumpy. I don't think there is a builtin way to fix this. You could
write a script to re-scroll the text using Ctrl-E/Ctrl-Y when you do
gj/gk to get around this issue though. You could of course file an
issue to Vim to see if there will be an appetite to add this as an
option.

On Fri, Oct 10, 2025 at 2:38 PM Marc Adler <marc.adler@gmail.com> wrote:
>
> I use Vim to write text, ie prose with paragraphs.
>
>
> Vim interprets a paragraph as a single line, but it's good at displaying line breaks anyway.
>
>
> The problem is that it skips up and down by paragraph when you scroll up and down with gj and gk, making the text jerky and difficult to read.
>
>
> Smoothscroll fixes this, but only when you're scrolling down.
>
>
> Is there a way to make it work when scrolling up?
>
>
> Here's an example of what I'm talking about. The first is Vim (Neovim) and the second is VSCode. The VSCode behavior is what you see in every other text editor.
>
>
> Vim:
>
> https://imgur.com/a/u83V2TA
>
>
> VSCode:
>
> https://imgur.com/a/8dhcXo1
>
>
> Is there a way to fix this? Like I said, this behavior is unique to Vim.
>
> --
> --
> You received this message from the "vim_use" 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_use" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/vim_use/6ac646eb-a298-4540-be5f-5e5b884a1803n%40googlegroups.com.

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vim_use/CAHTeOx_iK55vy2xeOk7UCy%3DK-eeC%2B%2BVU_24Ri5zZLUKqMFg%3D5A%40mail.gmail.com.

No comments: