Scroll another window in VIM Split

How to scroll another window to :vsplit in VIM? I searched everywhere, but all websites talk about how to synchronize both windows for scrolling. I want to see one file, edit it by scrolling through another.

+6
source share
1 answer

I am pretty (normal, perfect) sure that nothing was created for this, not least because it only makes sense when there are exactly two windows. However, for this particular case, you can use matching. Put them in your ~/.vimrc :

 nmap <aj> <cw>w<ce><cw>w nmap <ak> <cw>w<cy><cw>w 

This will cause Alt + J to scroll down and Alt + K up, you can change them as you wish. If you want it to work with a lot of windows, you need to write a script.

+12
source

Source: https://habr.com/ru/post/909589/


All Articles