

Emacs follow-mode - cpr
http://stackoverflow.com/questions/970292/emacs-multiple-columns-one-buffer

======
cpr
I've been using Emacs for 32 years (hard to believe) and never knew about this
incredible but apparently obscure feature of Emacs.

On my 27" cinema display, even using 12pt Monaco for my tired old eyes for
extreme legibility, I can get 4-5 columns of 90 lines each, when editing
source files or text, for an effective "screen length" of 360-450 lines. With
10pt, you can get 500+ lines "on screen" easily.

Docs: [http://www.gnu.org/software/libtool/manual/emacs/Follow-
Mode...](http://www.gnu.org/software/libtool/manual/emacs/Follow-Mode.html) .

~~~
kraemate
I simply rotate my flatscreen monitor to make it upright. This way i get
900x1600 resolution, and >80 lines (10pt monospace) in one screen.

32 years of emacs! Wow!

~~~
mitchty
I've not been alive for 32 years....

But still learning Emacs, I still run it in viper mode. My old habits die
hard. I love to troll the other unix admins at work with vi keybindings in
emacs.

I'm assuming you aren't rotating your screen under linux, xinerama isn't very
robust on things like that.

~~~
kraemate
Yep, using linux (and KDE). Screen rotation works perfectly. [stock intel 965]

------
dmpatierno
In vim, with scrollbind:

    
    
      nmap <silent> <Leader>ef	:vsplit<bar>wincmd l<bar>exe "norm! Ljz<c-v><cr>"<cr>:set scb<cr>:wincmd h<cr>:set scb<cr>
    

Source: <http://markmail.org/message/kbnyhxffy6zs7pic>

~~~
pyre
There is also this:

<http://mysite.verizon.net/astronaut/vim/index.html#MPAGE>

~~~
edanm
This seems to be a 404 for me.

Is it working for other people?

~~~
DougBTX
Yes

------
bch
I try to not be surprised by the power and flexibility of Emacs. Having been
impressed so much over the years, I've tried to come to know it as simply
"awesome". That said, it's _hard_ to not be impressed when it shows itself as
even more awesome, even when you thought you were prepared for that
eventuality ;)

~~~
zokier
emacs is one of those things I really would like to use, but never actually
manage to bring myself to switch.

------
nileshk
follow-mode is great. I use functions that:

1\. split into three or four windows

2\. balance the windows (so each takes up equal amount of space)

3\. turn on line highlighting

Line highlighting helps because when using follow-mode it can become difficult
to quickly spot where the cursor is without it (e.g. if you do an incremental
search, the cursor could end up in any one of the many windows).

You can find the functions I wrote here, search for functions that end in
"-and-follow":

[https://github.com/nileshk/emacs/blob/master/nileshk/functio...](https://github.com/nileshk/emacs/blob/master/nileshk/functions.el)

What I'd like to have is a function that dynamically opens just enough windows
so that the entire file you are editing is entirely visible (possibly with an
upper limit for number of windows that can be set).

~~~
6ren
line highlighting is just what I need! For vim, it's

    
    
      :set cursorline
    

Note: it's slow on old computers
[http://vim.1045645.n5.nabble.com/Vim-7-slows-down-when-
highl...](http://vim.1045645.n5.nabble.com/Vim-7-slows-down-when-highlighting-
cursor-line-td1148280.html)

------
program
The documentation is misleading. You can use follow-mode on an arbitrary
number of windows that show the same buffer.

------
eighty
I think a fun interview question might be how to implement follow-mode.

~~~
to3m
Wow, what role are you interviewing for?!

------
iamelgringo
You can do that in Sublime Text as well: File -> Clone File

<http://www.sublimetext.com/>

~~~
pyre
Will the cursor automatically swap between the buffers when you reach the
edge? (e.g. buffer 1 is showing page 1 and buffer 2 is showing page 2; when
you get the end of page 1, the cursor/focus switches to buffer 2, rather than
it just being two independently scrolling views into the same file)

~~~
cpr
That's right--this is not just multiple views on one file/buffer, this is
multiple views that are synchronized to follow one another, to give you the
full effect of one long view.

~~~
ivank
I'm not seeing that by default in Sublime Text 2 (2076) - is there anything I
have to toggle?

~~~
cpr
Sorry, my grandparent comment was about Emacs, not Sublime Text.

------
thebandrews
Thanks for the post! The way I solved this problem in the past was to rotate
one of my monitors 180 degrees. People always make comments when they walk
into my cube for the first time, but you sure can fit a lot of txt on the
screen. Maybe now I can go back to a normal orientation on my monitor.

------
gnufs
"A Guided Tour of Emacs" has a screenshot of the follow-mode along with a
simple explanation: <http://www.gnu.org/software/emacs/tour/>

------
by
This would be good to build into the windowing system so it could apply to any
application. Split any application window horizontally or vertically and put
the two parts where you like on the screen.

------
swah
OTOH if you need follow-mode, aren't your functions too long?

~~~
pivo
Probably, but sometimes you have to work on other peoples's code. The worst
for me was a 312 line function, which nearly caused me to quit.

~~~
LukeShu
I don't think that people give this situation enough credit. I once took over
a project of about 30,000 lines of C++, with only about one line of commenting
per 1,000 lines; and was frustrated with a lot of
tools/documentation/suggestions that amounted to "don't write code like that".
(Doxygen ended up being my friend)

------
abcd_f
Alright, cool. So how is it called in vim? ;)

------
aboodman
Hey, really cool trick. Thanks for sharing!

