vimwindowredrawtext-cursor

Vim - zt will redraw the window with the cursor at the top. Can you redraw with it say, 4 lines down?


Reading the manual with ':help z' shows a variety of commands which can redraw the window, e.g. z.to redraw with the cursor in the centre or zb to redraw with it at the bottom of the screen.

zt is nice but I would find it much more comfortable to be able to redraw with the cursor 25% of the way down the page (so that what I was just writing is still visible). Is there an easier way to accomplish this other than macro-ing it?


Solution

  • You can use the 'scrolloff' option:

    set scrolloff=4
    

    See :help 'scrolloff'.