How do I scroll the other window in :vsplit
in VIM? I've looked everywhere, but all websites are talking about how to sync both windows to scroll together. I want to look at one file, edit it, while scrolling the other.
I'm fairly (ok, quite) certain there's nothing built in to do this, not least of all because it only makes sense when there are exactly two windows. For that specific case, however, you can use a mapping. Put these in your ~/.vimrc
:
nmap <a-j> <c-w>w<c-e><c-w>w
nmap <a-k> <c-w>w<c-y><c-w>w
This will make Alt+J scroll down and Alt+K up, you can change those as you like. If you want it to work with more windows, you'll have to write a script.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With