sponsor Vim development Vim logo Vim Book Ad

basic Tip #52: Scrolling synchronously

 tip karma   Rating 146/46, Viewed by 2933 

created:   March 18, 2001 12:27      complexity:   basic
author:   Anonymous      as of Vim:   5.7

If you want to bind two or more windows such that when one
window is scrolled, the other windows are scrolled simultaneously,
set the 'scrollbind' option for these windows:

:set scrollbind

When a window that has 'scrollbind' set is scrolled, all other
'scrollbind' windows are scrolled the same amount, if possible.

For more information about the 'scrollbind' option refer to

:help scoll-binding

 rate this tip  Life Changing Helpful Unfulfilling 

<< Entering german umlauts | Better colors for syntax highlighting >>

Additional Notes

[email protected], April 20, 2001 13:43
And for those who are in versions prior to the scrollbind
days, these maps help.  They are intented for use with 2
windows open for scrolling.  (I believe this was lifted from
Dr. Campbell).

"       { Scroll two windows up and down in parallel. }
nmap j <C-E><C-W>W<C-E><C-W>w
imap j <Esc><C-E><C-W>W<C-E><C-W>wa
nmap k <C-Y><C-W>W<C-Y><C-W>w
imap k <Esc><C-Y><C-W>W<C-Y><C-W>wa
[email protected], September 22, 2005 10:07
That's ":help scroll-binding"...
If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to [email protected] after searching the archive. Help Bram help Uganda.
    stats
Sponsored by Web Concept Group Inc. SourceForge.net Logo