"I have a mind like a steel... uh... thingy." Patrick Logan's weblog.

Search This Blog

Tuesday, October 28, 2008

Emacs Rectangles

emacs rectangle commands: list them like this... "control-h a" runs the "apropos" command. Then type "rectangle", and see the list.

A rectangle in emacs is defined just as a "region" is: between the "mark" and the "point". Set the "mark" using control-space. Then navigate the cursor to some other character. The location of the cursor is the "point". These two locations are the beginning and end of the region, and they are also the opposite corners of the current rectangle, for rectangle commands.

The two I use most are "kill-rectangle" at "control-x r k" and yank that back in over and over with "yank-rectangle" at "control-x r y".

Em, but maybe you need to store a number of rectangles and yank them back in randomly. well...

"copy-rectangle-to-register" at "control-x r r". what? you do know about emacs registers, right? super-cool... next time.

1 comment:

Lauri said...

Check out the rectangle support built into cua-mode:

http://trey-jackson.blogspot.com/2008/10/emacs-tip-26-cua-mode-specifically.html

I really like the visual feedback and the insertion modes.

-- Lauri

Blog Archive

About Me

Portland, Oregon, United States
I'm usually writing from my favorite location on the planet, the pacific northwest of the u.s. I write for myself only and unless otherwise specified my posts here should not be taken as representing an official position of my employer. Contact me at my gee mail account, username patrickdlogan.