refers to the shape of the selected text area; it can be any arbitrary rectangular area of the text buffer extending multiple lines and need not include the entire line.
Questions tagged [rectangle]
52 questions
18
votes
2 answers
How to act on rectangles beyond the end-of-line?
Here's what Vim's documentation has to say about it:
Virtual editing means that the cursor can be positioned where there is
no actual character. This can be halfway into a tab or beyond the end
of the line. Useful for…

nanny
- 5,704
- 18
- 38
12
votes
3 answers
How to copy killed rectangle to the kill ring
I frequently extract a rectangle of text from a buffer, but then find I want to yank the text as if it was not a rectangle. Is there a way to add the current killed rectangle to the kill ring?
The GNU Emacs Manual has this to say:
“Killing” a…

nispio
- 8,175
- 2
- 35
- 73
12
votes
2 answers
How do i get rid of "default" (last used) string in some emacs functions?
I have the following problem : when i use 'C-x r t' (string-rectangle), i am prompted to enter some string, to replace the selected rectangle. Lets say i type ";;" (to comment out the rectangle). This works just fine, but the next time i call the…

mation
- 121
- 3
9
votes
2 answers
How to overwrite a copied rectangle instead of inserting it (which is the default behavior of yank-rectangle)?
After copying a "rectangle" using C-x r M-w, doing C-x r y yanks or pastes the rectangle. But that inserts the copied rectangle.
How can I paste the copied rectangle so that it overwrites the text?
Example:
a b c d e f g
h i j k▮l m n
o p q r s t…

Kaushal Modi
- 25,203
- 3
- 74
- 179
9
votes
7 answers
How to input number-series (with appointed amount) in Emacs?
I want to input 90 number-series starts from 1, here is what I did:
set-mark
type enter 90 times
C-u C-x r N Enter %3d Enter
The output is like this:
1
2
3
4
5
6
7
....
90
Is there a way to set the amount of output? (I don't want to hit…

Nick
- 4,423
- 4
- 24
- 41
8
votes
3 answers
How to select (and copy) a column of an org table *without* rectangle selection?
It seems to me that the normal way to copy a column of an org table is by rectangle selection (see here). That is, first the column is selected by marking all of it by hand, and then it is copied with org-table-copy-region or the like.
What I would…

Timm
- 1,549
- 12
- 23
8
votes
2 answers
Insert lines when yanking rectangle rather than inserting among following lines?
Having copied the 3x3 rectangular region containing a's, how can I yank/paste that content at the desired point without slicing into the following text? The following is the behavior for:
M-w (kill-ring-save), M-y…

ebpa
- 7,319
- 26
- 53
8
votes
2 answers
Yank a column of text copied from the clipboard
I often seem to want to copy paste multiple columns, for example, I paste one column
line one
line two
line three
Now I'd like to be able to yank another column behind it. Assuming my kill buffer has the following:
added to one
added to two
added…

hbogert
- 191
- 1
- 6
7
votes
1 answer
Enable Emacs column selection using mouse
How to use mouse to select column in Emacs? How to enable it?
The emacs wiki RectangleMark says,
there is mouse support for rectangle highlighting by dragging the
mouse while holding down the shift key. The idea is that this behaves
exactly…

xpt
- 447
- 3
- 16
7
votes
3 answers
How to select and delete a column of text in emacs?
I have this text
1 A
2 B
3 C
I want to remove the first column to make it
A
B
C
Ok so I need to make a rectangle. Reading about rectangles I see
"To specify a rectangle for a command to work on, set the mark at one corner and point at the opposite…

BigBoy1337
- 221
- 1
- 7
5
votes
4 answers
Add a constant decimal value to a column of numbers
Suppose I have a file containing the following:
ATOM 10 H5 LIG 1 -0.684 2.034 0.000 1.00 0.00
ATOM 11 C1 LIG 1 0.974 0.686 0.000 1.00 0.00
ATOM 12 H1 LIG 1 1.734 1.451 0.000 1.00 …

holocronweaver
- 1,319
- 10
- 22
5
votes
1 answer
Highlight rectangle and non-rectangle selection at the same time
By default, Emacs highlights the non-rectangular selection; alternatively, you can use (rectangle-mark-mode) to show the rectangular selection. Instead, I'd like to always show both, by highlighting the rectangle in one face, and the normal…

Cactus
- 165
- 4
5
votes
2 answers
Copy text as rectangle
This is the block of text that I intend to copy as rectangle (without the line numbers).
1. ALM_KRmet_DCDO_RPMP_START
2. ALM_KRmet_DCDO_RPMP_STOP
3. ALM_KRmet_DIDC_RPMP_TRIP
4. ALM_KRmet_RPMP_J_H
5. ALM_KRmet_DIDO_PUMPOUT
6.…

Prasanna
- 1,470
- 16
- 30
5
votes
3 answers
How to find and replace regex within a rectangle selection block
I have the following text:
| Row # | Facility | Recycled Off-site |
|-------+--------------------------+-------------------+
| 1 | 1234, 12th st, jamestown | 216,574 |
| 2 | 1234, 12th st, jamestown | …

modulitos
- 2,432
- 1
- 18
- 36
4
votes
3 answers
Copy a column of uneven width that ends with a specific character
I have a data file that looks as follows
ALGO = Fast
EDIFF = 6.7e-05
ENCUT = 520
IBRION = 2
ICHARG = 1
ISIF = 2
ISMEAR = 0
ISPIN = 2
I'm interested in copying the first column of uneven width but where every element ends with an = character.
The…

rambalachandran
- 245
- 1
- 12