Primitive rectangular block modeEmacs takes a rectangular operation with commands beginning with C-x R. Use c-space or [email protected] to set a mark and move the cursor to another point to perform a column operation with the following command:
C-x r r Copy a rectangular area to register c-x R K cut a rectangular block C-x r y Paste a rectangular block C-x r o Insert a rectangular block C-x r C Clears a rectangular block (making it blank) C-x R T inserts a kind of character before all columns in the selected range |
Rect-markSometimes I have this requirement and I want to delete the column at the beginning of a row of 29 rows, as follows:I need to delete the number at the beginning of the line, this time Emacs's own rectangular region selection will not work, need to use a plug-in called Rect-mark, using this plugin can be activated by m-x Rm-set-mark Rectangle selection mode, select and then use the original rectangle Operation command, For example, remove the number line c-x R K to replace the other characters c-x r t install rect-mark.el plug-in Http://www.emacswiki.org/emacs/RectangleMark download the plug-in after theown LoadPath, and then add in. emacs (Require ' Rect-mark)Some shortcut key configurations
(Global-set-key (kbd "C-x r c-spc") ' Rm-set-mark ') (Global-set-key (kbd "C-x r c-x") ' Rm-exchange-point-and-mark ') (Global-set-key (kbd "C-x r c-w") ' Rm-kill-region ') (Global-set-key (kbd "C-x r m-w") ' Rm-kill-ring-save ') (AutoLoad ' Rm-set-mark "Rect-mark" "set mark for rectangle." T) (AutoLoad ' Rm-exchange-point-and-mark "Rect-mark" "Exchange point and mark for rectangle." T) (AutoLoad ' rm-kill-region "Rect-mark" "kill a rectangular region and save it in the kill ring.") (AutoLoad ' Rm-kill-ring-save "Rect-mark" "Copy a rectangular region to the kill ring." T)
Emacs Rectangle Operation