10

I find myself dealing with this issue every time the wrap option is active (in my particular case whenever I'm working with markdown files).

What happens is that, while scrolling up and down the buffer with j and k, the wrapped lines of text (visually forming a paragraph) at the far top and far bottom don't scroll smoothly (i.e. one by one) out of screen. Instead, whole paragraphs disappear and reappear abruptly from and into view, making for a disorienting and annoying effect.

I think a GIF will explain better what happens. Here, I'm just pressing k repeatedly to scroll upwards. Keep an eye on the paragraph near the bottom!

ugh

I got used to this behaviour because I didn't think it was fixable, but then I realized that doesn't happen with physical lines and wrap unset.

Is there a way to tell Vim to scroll out of screen by visual lines instead of physical ones?

ps: Yes, I've mapped my j and k to gj and gk.

5

That is an issue, that has been often requested but never been implemented. So no, there is no possibility for a better and smoother scrolling, once the lines wrap.

  • Are you able to provide a link to where this issue has being discussed? I'd like to know more. – zool Aug 26 '15 at 11:39
  • 1
    here or here – Christian Brabandt Aug 26 '15 at 13:08
2

I think you are looking for:

set display=lastline

See :help 'display'.

  • That kinda worked but I still don't get the smooth, line-by-line scrolling I get when wrap is unset. The behavior now looks actually inconsistent: more gradual (but still not line-by-line) scrolling while going up, and abrupt paragraph appearance when going down (see GIF). – zool Aug 24 '15 at 19:38
  • Too bad, cause reading the help page that really looked like my option. – zool Aug 24 '15 at 19:39
  • 2
    According to :help 'scrolljump' I think that the minimum jump you can get is one line when the cursor moves off-screen. But with wrap set as in your case, one line may occupy multiple screen lines. – Vitor Aug 25 '15 at 9:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.