Wednesday, June 5, 2013

Re: sidescrolloff, but only for long lines?

On 05/06/13 19:31, Stephen Talley wrote:
> I use sidescrolloff to make sure I can see several columns ahead of the cursor
> on long lines. However, even when a line is short enough to fit entirely on the
> screen, vim still scrolls even though there is no need to.
>
> Is there a way to turn off horizontal scrolling when a line doesn't need it?
>
> For example:
>
> :set sidescrolloff=10
> :set nowrap
>
> On a 80-character-wide terminal, with this text:
>
> This is a very long long long long long long long long long long long sentence.
>
> Putting the cursor on the last character of that line makes vim scroll to the
> point where "This is a " is not visible. Since the line can fit entirely within
> the bounds of the screen, I'd like it to not scroll.
>
> Is there a way to limit horizontal scrolling to only scroll when there is more
> of the line to be seen?
>
> Thanks,
>
> Steve
>

Try using 'sidescroll' instead, and setting 'sidescrolloff' to 0 (which
is the default).

'sidescrolloff' is by design the number of text columns to be shown on
both sides of the cursor (including empty -or virtual- columns after the
cursor position).


Best regards,
Tony.
--
Illinois isn't exactly the land that God forgot -- it's more like the
land He's trying to ignore.

--
--
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.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment