Выбрать главу

Table 4-3 summarizes the commands for working with the buffer list.

Table 4-3. Buffer list commands

Keystrokes Action Occurs
C-n, Space, n, or Move to the next buffer in the list (i.e., down one line). Immediately
C-p, p, or Move to the previous buffer in the list (i.e., up one line). Immediately
d Mark buffer for deletion. When you press x
k Mark buffer for deletion. When you press x
s Save buffer. When you press x
u Unmark buffer. Immediately
x Execute other one-letter commands on all marked buffers. Immediately
Del Unmark the previous buffer in the list; if there is no mark, move up one line. Immediately
~ Mark buffer as unmodified. Immediately
% Toggle read-only status of buffer. Immediately
1 Display buffer in a full screen. Immediately
2 Display this buffer and the next one in horizontal windows. Immediately
f Replace buffer list with this buffer. Immediately
o Replace other window with this buffer. Immediately
m Mark buffers to be displayed in windows. When you press v
v Display buffers marked with m; Emacs makes as many windows as needed. Immediately
q Quit buffer list. Immediately

4.6 More About Windows

Depending on your requirements, you may want to work with side-by-side windows in addition to or instead of horizontal windows. For finer control, you may want to know how to size windows (and because they're not GUI windows, you can't do that with the mouse).[23] You may also want to know how to compare files between windows, a good feature for basic file comparison.

4.6.1 Creating Vertical or Side-by-Side Windows

To split the window vertically into two side-by-side windows, type C-x 3. You can execute this step repeatedly to create more side-by-side windows.

Type: C-x 3

Emacs creates two vertical windows.

When you create multiple vertical windows, Emacs usually doesn't have enough room to display a full line of text. Because vertical windows don't usually show full lines of text, a right arrow (on graphical implementations) or a dollar sign (on terminal-based implementations) at the end of a line tells you the line is continued.

To see the rest of the line, you need to know how to scroll text to the left and right. To push the text currently being displayed to the left (so you can see what's on the right), type C-x <. Left arrows or dollar signs are displayed on the left side of the window to indicate that there is more text to the left. To push the text being displayed to the right (so you can see what's on the left), type C-x >. You can use these commands whenever one of your lines is too wide, which can happen with or without windows.

вернуться

23

It's true that you can't resize Emacs windows using the mouse. But if you resize an Emacs frame, it does impact the size of the windows, even eliminating windows at times if the frame cannot display all the windows. Of course, as always, eliminating a window doesn't impact the underlying buffer.