Is it possible to :e a buffer in vim without having the scrolling adjusted?

The behavior I see: the file is reloaded followed by a zz (redraw with line count at center of window). I'd like to just reload the file.

  • Well, you could map over zz or :e to mark your position, run the original command then and then return to that spot. But, that's ugly and I would hope there is a better way to solve this.
    – Shadoath
    Nov 13, 2017 at 2:51

1 Answer 1


The anwolib plugin has a :KeepView command that modifies any Ex command to keep the current window layout. You can then use

:KeepView edit!

to reload while keeping the current view.

Alternatively, you can implement this yourself using winsaveview() and winrestview().

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .