Wikia

Vim Tips Wiki

Changes: Scrolling synchronously

Edit

Back to page

(Comments: getting back in sync)
(Change <tt> to <code>, perhaps also minor tweak.)
Line 18: Line 18:
 
</pre>
 
</pre>
   
You can enter <tt>scb</tt> as an abbreviation for scrollbind, and the <tt>!</tt> flag causes <tt>:set</tt> to toggle a boolean option. Therefore, it is convenient to enter the following to toggle scrollbind on or off:
+
You can enter <code>scb</code> as an abbreviation for scrollbind, and the <code>!</code> flag causes <code>:set</code> to toggle a boolean option. Therefore, it is convenient to enter the following to toggle scrollbind on or off:
 
<pre>
 
<pre>
 
:set scb!
 
:set scb!
 
</pre>
 
</pre>
   
When you scroll a window which has <tt>'scrollbind'</tt> set, all other <tt>'scrollbind'</tt> windows are scrolled the same amount, if possible.
+
When you scroll a window which has <code>'scrollbind'</code> set, all other <code>'scrollbind'</code> windows are scrolled the same amount, if possible.
   
 
==References==
 
==References==

Revision as of 05:10, July 13, 2012

Tip 52 Printable Monobook Previous Next

created 2001 · complexity basic · version 5.7


When you are displaying more than one window, you can set the scrollbind option in each window so they scroll together.

In each window that should scroll simultaneously, enter the command:

:set scrollbind

You can enter scb as an abbreviation for scrollbind, and the ! flag causes :set to toggle a boolean option. Therefore, it is convenient to enter the following to toggle scrollbind on or off:

:set scb!

When you scroll a window which has 'scrollbind' set, all other 'scrollbind' windows are scrolled the same amount, if possible.

References

Comments

...and, if your scrollbound windows ever get out of sync, in gvim it's possible to adjust them, as follows: scrolling the current window (by any means) will scroll all scrollbound windows together, but scrolling a non-current window (by means of its scrollbar) won't scroll the other one(s) with it. — Tonymec 00:43, April 4, 2010 (UTC)

Around Wikia's network

Random Wiki