Subject: Wanted editor feature: synchronized horizontal split

From: Amit Aronovitch <[email-masked]>
Date: Sat, 25 Sep 2010 17:01:39 +0200

When reading (or editing) long textual documents, especially source code,
you always have to compromise between viewing larger portions of the code at
once (to get a wider context), and having reasonably sized fonts (long
documents take long time to read, you wouldn't want to stress your eyes too
much).
Since code typically has a fixed, relatively short, line width, there is no
point in stretching your window horizontally. Only vertical stretching
helps, and you are limited by the height of your screen.
The problem became even worse with the increased popularity of wide-screens
(for a given screen area, you now get shorter screens, and either have to
settle for less lines to display or strain the eyes with smaller sized
fonts).

I think that the best way to use screen area in modern wide screens would be
to "cut" a "virtual" tall window into two halves and have them displayed
side by side. In other words, have a wide window for your editor, which is
horizontally split in two halves, where lines from the top of the right pane
scroll into the bottom of the left pane and vice versa.
In Emacs I can simulate a crude version of this by carefully resizing and
scrolling two views of the same buffer, such that the top line of the right
view follows the bottom line of the left one
(see screenshot in  http://dl.dropbox.com/u/6960989/horizsplit.png ), and
then turn on "scroll-all-mode" to force synchronized scrolling.
However:
* It is a bit tricky to set up.
* You loose synchronization if you try to scroll beyond the top or bottom of
your file.
* I would like to have a single scrollbar, cursor and status line, rather
than two (which is confusing).
(well, maybe there is a special emacs mode for what I want, but I do not
know of such).

Now the question:
Is such a feature available in your favorite editor? Do you know of a good
editor that supports this?
If not - should not be hard to implement - maybe somebody already wrote such
an extension...

    AA

---

From: Shlomi Fish <[email-masked]>
Date: Sun, 26 Sep 2010 12:49:47 +0200

Hi Amit,

On Saturday 25 September 2010 17:01:39 Amit Aronovitch wrote:
> you always have to compromise between viewing larger portions of the code
> at once (to get a wider context), and having reasonably sized fonts (long
> documents take long time to read, you wouldn't want to stress your eyes
> too much).
> I think that the best way to use screen area in modern wide screens would
> be to "cut" a "virtual" tall window into two halves and have them
> displayed side by side. In other words, have a wide window for your
> editor, which is horizontally split in two halves, where lines from the
> top of the right pane scroll into the bottom of the left pane and vice
> versa.
> * You loose synchronization if you try to scroll beyond the top or bottom
> of your file.

It is available in Vim using the ":setlocal scrollbind" feature (tried it now 
and it works). Here is the excerpt from the Vim FAQ about it:

{{{
10.8. How do I scroll two or more buffers simultaneously?

You can set the "scrollbind" option for each of the buffer to scroll them
simultaneously.

For more information, read

    :help 'scrollbind'
    :help scroll-binding
    :help 'scrollopt'
}}}

And Vim/gvim is my favourite editor. :-)

Regards,

	Shlomi Fish

> If not - should not be hard to implement - maybe somebody already wrote
> such an extension...
> 
>     AA

-- 
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
What Makes Software Apps High Quality -  http://shlom.in/sw-quality

<rindolf> She's a hot chick. But she smokes.
<go|dfish> She can smoke as long as she's smokin'.

Please reply to list if it's a mailing list post - http://shlom.in/reply .

---

From: Amit Aronovitch <[email-masked]>
Date: Sun, 26 Sep 2010 13:23:52 +0200

On Sun, Sep 26, 2010 at 12:49 PM, Shlomi Fish <[email-masked]> wrote:

> In emacs, if you bind the views, and then scroll up until the left half
reaches the top, then further scroll-ups would only scroll the right half
and you lose sync. Similar thing happens when the right half reaches the
bottom.
Does Vim avoid this problem?
Also, what about scrollbars and cursors - do you get a single one (as I
want) or two of each (as I get in emacs)?

Finally, is there an emacs-like keyboard binding for Vim (the reverse of
emacs' "viper" mode)?

   AA