Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emacs: multiple views of same file

Tags:

emacs

I'm trying to view the same file in 2 buffers, one at normal scale and the other zoomed out, to see the whole buffer (as in notepad++ document map: http://notepad-plus-plus.org/assets/images/docMap.png ).

Is there any way visit the same file in different buffers, so that each buffer can have different settings?

like image 569
adh Avatar asked Dec 18 '12 19:12

adh


People also ask

Can you open more than one buffer in Emacs?

Much better to use the multiple buffer feature of emacs. If you are editing the first file and want to start editing the second file, simply use the hot key C-x C-f or the menu selection File->Open File to start the second file. The second file is loaded into its own buffer.

Can you only have one buffer open in Emacs at a time?

Each Emacs window displays one Emacs buffer at any time. A single buffer may appear in more than one window; if it does, any changes in its text are displayed in all the windows where it appears. But the windows showing the same buffer can show different parts of it, because each window has its own value of point.

How many buffers can you have in Emacs?

This is because Emacs tracks buffer positions using that data type. For typical 64-bit machines, this maximum buffer size is 2^{61} - 2 bytes, or about 2 EiB. For typical 32-bit machines, the maximum is usually 2^{29} - 2 bytes, or about 512 MiB.

How many buffers can you have open in Emacs at a time?

The number of buffers you can have really has no limit. Most of the time, only one or two buffers are displayed, but even if you can't see them, all the buffers you create in an Emacs session are still active. You can think of them as a stack of pages, with the one being displayed as the top page.


2 Answers

Try M-x clone-indirect-buffer (or M-x clone-indirect-buffer-other-window aka C-x 4 c), and then you can set the font in one of the buffers real small.

You can make the font smaller or larger in a buffer with the bindings C-x C-- or C-x C-+, which run the command text-scale-adjust.

There was a mode that someone made that did this splitting/shrinking automatically, but I'm unable to find it.

like image 118
Trey Jackson Avatar answered Sep 29 '22 06:09

Trey Jackson


You want to install the minimap package (it's in GNU ELPA) which does just that.

like image 35
Stefan Avatar answered Sep 29 '22 08:09

Stefan