Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In vim, how to scroll horizontally, by just one character, when cursor reaches end of the window? [duplicate]

Tags:

vim

Instead, vim scrolls the view by one full page, making it very difficult to follow a long line of code.

Line wrapping is of course disabled, and we want to just use the arrow keys and not zl.

Is there a vim option for configuring in .vimrc the desired behavior?

like image 639
silvernightstar Avatar asked Apr 18 '13 14:04

silvernightstar


People also ask

How do I scroll sideways in Vim?

You just press z once in order to trigger the "horizontal scrolling mode", which stop as soon as you press any other key.

How do I scroll in Vim?

You can make Vim scroll the text using the shifted up/down arrows by mapping Shift-Up to Ctrl-Y and Shift-Down to Ctrl-E. Shift-Down will then scroll down (like moving a scroll-bar down, or like moving a cursor at the bottom of a window down), and Shift-Up will then scroll up (like moving a scroll-bar up, etc).

How do I scroll horizontally in a div?

Set the overflow-y: hidden; and overflow-x: auto; that will automatically hide the vertical scroll bar and present only the horizontal scrollbar. The white-space: nowrap; property is used to wrap text in a single line. Here the scroll div will be horizontally scrollable.

How do you scroll horizontally in Linux terminal?

Terminals are not designed to scroll horizontally. Use less -S to allow scrolling left and right as well as up and down.


1 Answers

You're looking for

:set sidescroll=1

(or any other small number). The default is 0, which scrolls by half a screen. See also sidescrolloff for how near the cursor must come to the border to trigger scrolling.

like image 92
Ingo Karkat Avatar answered Oct 06 '22 09:10

Ingo Karkat