emacs – rectangles


Working with rectangles in emacs:

When you must specify a rectangle for a command to work on, you do it by putting the mark at one corner and point at the opposite corner (C-SPACE).

C-x r k : Kill the text of the region-rectangle, saving its contents as the “last killed rectangle” (kill-rectangle).

C-x r d : Delete the text of the region-rectangle (delete-rectangle).

C-x r y : Yank the last killed rectangle with its upper left corner at point (yank-rectangle).

C-x r o : Insert blank space to fill the space of the region-rectangle (open-rectangle). This pushes the previous contents of the region-rectangle rightward.

M-x clear-rectangle : Clear the region-rectangle by replacing its contents with spaces.

M-x delete-whitespace-rectangle : Delete whitespace in each of the lines on the specified rectangle, starting from the left edge column of the rectangle.

C-x r t string RET : Replace rectangle contents with string on each line. (string-rectangle).

M-x string-insert-rectangle RET string RET : Insert string on each line of the rectangle.


Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: