0

Context:

There are 2 and only windows in vim. I want when I press F2, cursor remain in the same window, the other window behave like PgDnpressed.

How to achieve that behavior?

P.S.

motivation: used in a preview mode, one window containing a dirvish buffer.

1

I think the following mapping should to the trick

nnoremap <F2> <C-w>p<C-f><C-w>p

It remaps F2 to change to the previously accessed window (:h CTRL-W_p), scroll down (:h CTRL-F) and come back to the previous window.

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.