Questions tagged [rectangle]

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.

Filter by
Sorted by
Tagged with
1
vote
1answer
18 views

Search within column or rectangle

Is there a simple way to search within the current column or within a rectangle? I am navigating a CSV file and would like to find the value "10" in a particular column. Searching the entire file is ...
0
votes
1answer
45 views

How can I apply a keyboard macro to every line that starts with rectangle mark region

Lets suppose I would like to edit my text and to add comments to the column in the text. This is my text: something-text1 foobar1 something-text1 something-text2 foobar2 something-text2 --- ...
0
votes
0answers
24 views

Pasting rectangle indents text to the right

Copying and pasting a rectangle from the following table with C-x SPC C-x r M-w C-x r y shifts the beginning of the line to the right as shown below: |----+----------+------+------+--------| | | ...
1
vote
1answer
40 views

untabify within a rectangular region?

How may I call untabify against a rectangular region? This screenshot illustrates what I am trying to accomplish. I have a messy mixture of tabs and spaces in the region I have circled. untabify ...
1
vote
1answer
15 views

Lines vanish when using string rectangle with line-wrap

I paste this text, copied from IBM's social responsibility, into an Emacs buffer where the frame is 80 characters, or is small enough to cause a line-wrap: 02 Education and skills We are ...
0
votes
1answer
47 views

how add vertical column to vertical column

I have column of text like this: Abba Foo Boo M and I want to transform it to: Abba = Abba Foo = Foo Boo = Boo M = M I can add " = " to end column of text via C-x space and M-x string-insert-...
3
votes
0answers
38 views

string-rectangle command pollutes kill-ring after upgrade to Emacs 25

In Emacs 24 I used to have a workflow for inserting a string into multiple lines at once: Go to the desired position in the first line. Press C-Space to place the mark. Go to the last line (while ...
2
votes
0answers
113 views

Aligning (ditaa) rectangles with variable string width in yasnippet

To quickly add simple diagrams to notes, I've created yasnippets for ditaa boxes. The text inside each box is a $x - and therefore has a length I do not know at snippet design time. As a consequence, ...
3
votes
3answers
113 views

immediately invoke string-rectangle upon rectangle-mark-mode selection

A common use-case that I have is to add a string to the same position of each line of text. For example, I might start with expect(one).toEqual(true); expect(two).toEqual(false); which I want to ...
1
vote
2answers
123 views

Transposing rectangular region

I have a piece of code like this in yaml. security_group_sig_egress_ipv6: "allowed_remote_sig_egress_ipv6" security_group_sig_ingress_ipv6: "allowed_remote_sig_ingress_ipv6" ...
1
vote
1answer
37 views

non-character input-event when using rectangular commands since version 24.4

Since version 24.4 and till 25.1 when I want to make a rectangular copy C-x r r RET I got the following message: non-character-input-event It appears that this problem happens only for rectangular ...
2
votes
4answers
234 views

Search/replace inside a rectangular region, without CUA mode

I want to use search/replace (string or regexp) inside a rectangular region (aka column selection?). Consider this question: Search and replace inside a rectangle in emacs That's what I want, except ...
1
vote
2answers
296 views

Copying an rectangular selection to system clipboard

Does anyone know a command or somtething to copy an rectangular selection (as with C-x r M-w / copy-rectange-as-kill) and put the killed rectangle into the system clipboard like with the kill-ring-...
5
votes
2answers
646 views

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. ...
0
votes
1answer
93 views

Inserting line break into a rectangle

I have a list that looks like 1.530 2.895 4.362 50.14 3.14 2.7 And I want it to look like 1.530 2.895 4.362 50.14 3.14 2.7 I suspect there is a clever way to use a rectangle to do this but I ...
5
votes
3answers
2k views

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 ...
1
vote
1answer
164 views

Virtual space for rectangular selections (at least)

In Vim there is the virtualedit variable which can be set so that Vim allows the cursor to move past the end of the line always or only when in visual block mode. Is it possible to configure Emacs to ...
0
votes
1answer
69 views

Copy rectangle text into org-table

I have 5 rows of text: 1 0% 2 от 1% до 20% 3 от 21% до 50% 4 от 51% до 100% 5 100% And I would like to copy everything after digits (1..5) to a table column PRC | N | PRC| | | | | |...
4
votes
3answers
183 views

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 ...
4
votes
2answers
184 views

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-...
7
votes
1answer
372 views

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 ...
4
votes
3answers
567 views

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 | | ...
1
vote
1answer
228 views

AUCTeX: toggle sub- and superscript-fontification

Or: How to put face changes in a defun? I use AUCTeX to edit my LaTeX files and I like the way AUCTeX displays the sub- and superscripts (not only in formulas). Not only it shifts the sub- or ...
1
vote
2answers
382 views

Kill rectangle with cua-mode support

There are many nice column editing features in CUA mode. After hitting Ctrl+RETURN, binded to cua-set-rectangle-mark, you get some help in the minibuffer: But I can't find the shortcut to cut/kill ...
2
votes
1answer
53 views

How to control width of rectangular selection in Emacs 25?

There is a cool new feature in Emacs 25: visual support for rectangular selection. However, I would like to set its width to one pixel when it's “logical” width is zero columns of text. By default it'...
4
votes
1answer
407 views

evil rectangles with point past EOL

When visually selecting rectangles with C-v in evil, the point is not allowed to pass the end of line. This is in contrast with: rectangle-mark-mode cua-rectangle-mark-mode Both of which allow the ...
4
votes
1answer
148 views

Find rectangular selection

Is there an easy way to search for other occurences of a selected rectangle, regardless of the column at which the pattern starts? As an example, when searching for the 4x2 text block in lines 1+2 in ...
12
votes
2answers
358 views

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 ...
1
vote
3answers
108 views

string-rectangle: how to make input vary?

How can string-rectangle or C-xrt convert aRandomText_-1 aRandomText_-1 aRandomText_-1 aRandomText_-1 aRandomText_-1 aRandomText_-1 aRandomText_-1 aRandomText_-1 aRandomText_-1 aRandomText_-1 ...
1
vote
1answer
244 views

Use multiple cursor if region is active, otherwise use CUA, how?

I’m trying to implement this when I press C-return: If there’s an active region, it activates multiple cursors by calling mc/edit-lines If there’s no active region, it initiates rectangular selection ...
2
votes
1answer
46 views

Bug in downcase-region when using cua-set-rectangle-mark?

Is the following a bug or a feature? If the former, how do I file? If the latter, can someone explain the logic? On the following content in my buffer (*scratch*), upon marking the inner rectangle ...
1
vote
1answer
393 views

rectangle-insert in Emacs 24.4

Emacs 24.3 had a nice way of inserting text into rectangles: Select rectangle. C-x r t <string-to-be-inserted> RET This doesn't seem to work in Emacs 24.4. I tried rectangle-mark-mode using C-...
5
votes
4answers
432 views

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 ...
6
votes
1answer
1k views

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 ...
3
votes
1answer
148 views

How can I make `string-rectangle` show the changes I'm about to make to the buffer?

For a while, I was building prerelease versions of 24.4. One of the features that I liked was that when I used string-rectangle (via C-x r t), the string that I was typing showed up live in the buffer....
6
votes
6answers
2k views

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 ...
16
votes
2answers
1k views

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 ...
10
votes
3answers
379 views

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 ...
8
votes
2answers
357 views

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? ...