Nathan
Nathan

Reputation: 2387

How to make horizontal scrolling one character at a time

Not sure if I'm wording the question right.

That's why I had a hard time finding the answer on google, like I usually do.
I have my vim set to never wrap lines. Keeps code cleaner.

But I don't like that if I'm moving the cursor across a line and get to the edge of the screen, the view jumps so that where I was at is now in the middle of the screen.

Is there a way to make it not do that? Like, so it just goes one character at a time
(or if I'm traveling by word, one word at a time, etc. Just so if I go the edge of the screen, the cursor stays at the edge of the screen, and the page moves inward under it)?

Upvotes: 1

Views: 104

Answers (1)

Greg Hurrell
Greg Hurrell

Reputation: 5437

You could check out the 'sidescroll' setting:

'sidescroll' 'ss'   number  (default 0)

    The minimal number of columns to scroll horizontally.  Used only when
    the 'wrap' option is off and the cursor is moved off of the screen.
    When it is zero the cursor will be put in the middle of the screen.
    When using a slow terminal set it to a large number or 0.  When using
    a fast terminal use a small number or 1.  Not used for "zh" and "zl"
    commands.

Upvotes: 2

Related Questions