I remember Notepad++ has this feature, which is really helpful to compare files. I want to realize the similar one in Vim. When moving cursor in one split, cursors in the other split windows will move automatically.
Is there a keyboard shortcut to move the cursor from one monitor to another in Windoows 7 (dual monitors)? Win + Shift + Arrow will move the active window from one monitor to the other.
Depending on what you're after, I see 2 possibilities.
1) Diffing windows
If you want to compare files, have a look at :help diff
. E.g.
You're on the shell:
$ vimdiff file1 file2
or $ vim -d file1 file2
You have one window open already:
:vertical diffsplit foo.c
You have 2 windows open already:
Do :diffthis
in each of them.
2) Scrollbinding windows
You might also like :help 'scrollbind'
and :help scroll-binding
, if you don't want to jump into diff mode. Thus in the easiest case it's only doing :set scrollbind
in both windows.
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