Below, I call V1 the original viewport and V2 the new one.
- Start
vim
and write 5 sample lines. Leave the cursor in the last line. - Issue
:split
.
- Expected behavior: V2 is opened below. V1 is inaltered, except that V2 now occupies the lower half lines previously displayed by V1.
- Actual behavior: V2 is opened below. V1 has been scrolled down by two lines.
Bear in mind that also happens with viewports full of text. The scroll is apparently proportional to the vertical position of the cursor relative to the top line and does not occur if the cursor is in the top line or the next-to-top line.
Is there any good reason for that behavior? For me, it is simply disorienting. Can it be disabled without changing the cursor position in V1? I did not find anything relevant in the docs.
PS: This is reproducible with vim -u NONE
.
:help :split
: "Split current window in two. The result is two viewports on the same file." I don't think the help would mention an inexistent feature. 2. Why do you think I think that?