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.
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.
Sign up to join this communityThe 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()
.
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.