Rectangles
C-x SPC or M-x rectangle-mark-mode activates rectangle selection at point.
If a mark is already active, it keeps that endpoint. Move point with the normal
motion commands to select the inclusive logical rows between point and mark
and the display columns between them. The selected pane highlights existing
selected cells, including during scrolling and resize.
C-x r M-w or M-x copy-rectangle-as-kill retains those rows without editing.
Reported Alt-w and the compatible Escape-w sequence both work after C-x r.
Copy requires active rectangle mode and a nonzero column span. A rejected copy
keeps the previously retained rectangle. Read-only text can be copied.
Cell boundaries
- Columns follow the buffer's tab stops and Unicode width, as drawing does. The default tab width is four cells; the effective buffer policy can override it.
- An edge touching a wide grapheme includes the complete cluster, including combining marks and joined emoji. A copied row can therefore be wider than the requested display span.
- Copy expands selected tab cells into retained spaces, including a fully selected tab. Source tabs stay intact.
- Short or empty lines contribute only existing selected text, without trailing padding. Row fragments exclude LF/CRLF separators and preserve literal text, including visible control characters rather than their drawn notation.
The session retains one rectangle, separate from the linear kill ring. Copy changes neither source text, cursor, mark, modification state nor undo history. The next successful rectangle copy replaces the retained rows and requested width. Ordinary linear copying and yanking use their existing ring.
Across buffers, copied tab cells remain spaces; complete killed tabs remain literal and use the destination tab stops. Every shared destination view sees the same published text. The configured history limits retain the newest compound rectangle as one complete unit, even beyond the soft payload target.
Toggle rectangle mode again or press C-g to deactivate selection while keeping
the mark. A normal C-SPC starts linear selection. Successful text edits deactivate
selection; a refused edit preserves it. Shared buffers keep one mark and mode,
while the selected pane's own point determines the visible rectangle.
Killing rows
C-x r k or M-x kill-rectangle removes and retains the selected rectangle.
It uses the same cell boundaries as copy and retains complete selected tabs as
literal tabs. A partially selected tab contributes selected cells as spaces and
leaves its unselected cells as spaces; untouched tabs retain their bytes. Short and empty
rows receive no padding, and LF/CRLF separators stay intact.
Every changed row publishes together as one undo/redo step. The initiating cursor moves to the top-left source row and column, following any retained tab prefix spaces. Other shared cursors and marks map through all row changes. One undo restores the original text, mark, initiating cursor and clean state when the operation began clean. Undo does not discard the retained rectangle.
Read-only text, inactive/zero-width selection and prompt-owned input refuse the kill without replacing the previous rectangle or changing any source row.
Inserting retained rows
C-x r y or M-x yank-rectangle inserts the retained rows at point across
successive logical lines. It uses the selected view's display column for each
row. If that column touches the interior of a wide glyph or tab on a later
row, prefix spaces reach that column before inserting the retained text and
the complete original glyph. No destination grapheme is split.
A short target line receives only the prefix spaces needed for a nonempty row. An empty retained row advances the block without adding spaces to an existing line. Missing target rows are created with the buffer's prevailing LF/CRLF separator; a new empty row has no column padding. Source fragments keep their actual unequal lengths, including wide-cluster expansion, without right padding. Complete retained tabs stay tabs and follow the destination buffer's tab stops. Rows are not retabulated to force the source rectangle's right edge.
All inserted rows, prefix padding and added separators form one undo/redo step.
The initiating cursor ends after the last row's actual insertion; shared views
and marks map through the complete change. Undo restores the original text,
mark, initiating cursor and clean state. The retained rectangle stays available.
Read-only or prompt-owned input refuses insertion without editing. An absent
block reports No rectangle to yank. The linear kill ring remains independent.
Logical grapheme blocks
With the modal startup profile, C-v enters Visual Block using the same native mark, rectangle resolver and transaction owner. Its inclusive edges count source graphemes rather than terminal cells. A whole tab or wide/combining cluster is one column and is copied literally; short rows contribute no trailing padding. The highlight projects those selected glyphs onto their native display cells.
Visual block d/c/y operates on every derived row atomically. The retained block also supplies a newline-separated linear view in the shared kill ring; modal p/P and native yank-rectangle preserve its logical-column insertion policy. Counted modal paste repeats each row horizontally within the documented expanded text limit. Native display-cell captures keep their original insertion policy and separate rectangle retention. See Visual selections.