Emacs — Using rectangles


In Emacs, you can not only select by lines, but also by columns. If you select by columns, the selection is called a rectangle. You can use rectangles with the following shortcuts:

  • C-@ or C-Space — start selection (as usual)
  • M-x delete-rectangle or C-x r d — delete the rectangle delimited by the start selection and the current cursor position
  • M-x kill-rectangle or C-x r k — then you can use — M-x yank-rectangle or C-x r y
  • M-x clear-rectangle or C-x r c — replace the contents of the rectangle with spaces
  • M-x open-rectangle or C-x r o — insert spaces in the area and push the original contents to the right

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: