I am using an interactive substitution that spans multiple lines. In order to determine whether each particular occurrence should be replaced, I need to see all lines that are included in the search criteria, but vim only displays the first line.

I know you can scroll the window with zz, zt and zb, but this doesn't appear to work in interactive substitute mode. Is there an alternative approach?

Here is an example command, which replaces three newlines with two:

  • First run /\n\n\n and then do :%s//\r\r/gce?
    – muru
    Mar 17, 2017 at 2:45

1 Answer 1


To answer my own question (and if I read the documentation on the [c] flag properly), I would have known that using CTRL-E and CTRL-Y scroll the screen up and down, respectively.

[c] Confirm each substitution. Vim highlights the matching string with...

CTRL-E to scroll the screen up {not in Vi, not available when compiled without the |+insert_expand| feature}

CTRL-Y to scroll the screen down {not in Vi, not available when compiled without the |+insert_expand| feature}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.