Live data from Hacker News

Emacs follow-mode

stackoverflow.com

11–20 of 52 posts

Re: Emacs follow-mode

#11
post #7

You can do that in Sublime Text as well: File -> Clone File http://www.sublimetext.com/

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)

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.

Re: Emacs follow-mode

#13

In vim, with scrollbind: nmap ef :vsplit wincmd l exe "norm! Ljz " :set scb :wincmd h :set scb Source: http://markmail.org/message/kbnyhxffy6zs7pic

It's a nice approximation, but it's also a hack—it doesn't take 'scrolloff' into account, and once you scroll too far in one of the windows they lose synchronisation.

Edit: You can record a macro to do something similar—create a vertical split, switch to it, disable scroll-bind, go forwards one screen, enable scrollbind, then switch to the other window. This doesn't lose synchronisation but it doesn't take 'scrolloff' into account either.

Re: Emacs follow-mode

#16
post #2

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://w…

17 years here and I am happy to make my acquaintance with Follow Mode! :)

Re: Emacs follow-mode

#17
post #11
post #7

Earlier quoted context omitted.

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)

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.

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

Re: Emacs follow-mode

#18
post #17
post #11

Earlier quoted context omitted.

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.

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

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

Re: Emacs follow-mode

#20
post #19

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

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.
Post reply on HN