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 ).