Column mode of Emacs

Source: Internet
Author: User
Document directory
  • Original column Mode
  • Visualized column Mode Supported by Cua-Mode

 

Original column Mode

Emacs commands starting with C-x r are used to perform rectangle operations. Use C-space or C-@ to set a mark and move the cursor to another point. Run the following command to perform Column Operations:

C-x r k cut a rectangle
C-x r y: paste a rectangle.
C-x r o inserts a rectangle.
C-x r c clears a rectangle (turns it blank)
C-x r t inserts sample characters before all columns in the selected area
Visualized column Mode Supported by Cua-Mode

In addition to the column Mode Supported by Emacs, emacs also supports a visual column mode through Cua-mode. In Cua-
In mode, pressing [C-return] will enter CUA
Rectangle mode. In this mode, you can click the mouse to confirm the start point, and then use the cursor key to select a rect range. This rect will be displayed in another color. Then we
You can easily perform operations on this rect. For example, [M-Up], [M-Down], [M-Left], and [M-right] can move this rect, [c-
Return] You can cancel this rect. [C-space] You can exit the Cua-rect mode and activate the selection in normal mode.

You can use the following command to perform Column Operations in Cua-mode:

Enter a character directly: this character is inserted before or after each line.
[M-B]: replace all characters in rect with spaces (tabs or spaces)
[M-C]: removes spaces on the left of all rows.
[M-F]: replace all characters in rect with a single character (prompting you to enter one character)
[M-I]: Add 1 to the number first found in each row (the number starting with 0x is automatically treated as a hexadecimal number)
[M-K]: Shear rect
[M-l]: converts all content in rect to lowercase letters.
[M-m]: Copy rect
[M-N]: replace each row in the rect with a string of auto-increment numbers (this function can be used to number each row)
[M-o]: The content of the rect is shifted to the right, and the selected rect is filled with spaces.
[M-R]: string that meets the regular expression with a string replacement character
[M-R]: Up and down reversal
[M-S]: replaces each row in the rect with a string (prompt input)
[M-T]: Replace the entire rect with a string (prompt input)
[M-u]: converts all content in rect to uppercase
[M-|]: execute a shell command on the rect

There are also some other commands you can directly look at the cua-base.el (emacs22 has come with Cua-mode ).

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.