4

I want to select a column in emacs and remove it. For example, here I want to remove the word test.

This is a test text...
This is a test text...
This is a test text...

In Visual Studio, or notepad++ I'd press Shift+Alt to go to the column mode. I didn't find answer in documentation page, how to select rectangle, but I'm sure Emacs should have some nice synonym to this word. How would I do it? Thank you

1
3

How do I select a rectangle in emacs?

Rectangle commands operate on rectangular areas of the text: all the characters between a certain pair of columns, in a certain range of lines. Emacs has commands to kill rectangles, yank killed rectangles, clear them out, fill them with blanks or text, or delete them. Rectangle commands are useful with text in multicolumn formats, and for changing text into or out of such formats.

To specify a rectangle for a command to work on, set the mark at one corner and point at the opposite corner. The rectangle thus specified is called the region-rectangle. If point and the mark are in the same column, the region-rectangle is empty. If they are in the same line, the region-rectangle is one line high.

The region-rectangle is controlled in much the same way as the region is controlled. But remember that a given combination of point and mark values can be interpreted either as a region or as a rectangle, depending on the command that uses them.

Read the rest of the link for an explanation of how to use rectangles to perform various tasks.

Source 12.5 Rectangles

3

In Emacs-24.4, the rectangle commands are alo made available via rectangular selection: hit C-x SPC and then move around to select a rectangle (it should be highlighted visually), after which you can use the usual C-w to remove it.

0

In emacs 24.3, you can first mark the rectangle-region by c-spc and then c-x r k to kill the rectangle-region.

More, type c-x r t to replace the rectangle-region with a string.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.