1

In vim, one could describe the "state" as the position of the cursor, the position of the screen view (ratio of screen viewable above cursor vs below), and the values of all latent variables and file buffers.

I know vim keeps track/history of cursor positions using jumplist, but does it also do that for the screen view?

Use case: Let's say I wanted to see if a term exists in the current screen view. So I search for it using /Foo, but since that word isn't in the current view, Vim jumps to the next occurrence. I can return the cursor to the previous position from where I searched, but that doesn't reset the screen view.

1

I know vim keeps track/history of cursor positions using jumplist, but does it also do that for the screen view?

No, a jumplist is only a jumplist. If you need to save/restore the view you have to do it manually. The relevant VimScript functions are :h winsaveview() and :h winrestview().

| improve this answer | |

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.