How to kill a rectangle, but how ordinary kill in Emacs?

I do not know how to express it. See the example below.

Input:

a
bc
deffffffff
gh
i

I set the character before the “c” and the current cursor after the “h” . And click C-x r kthat M-x kill-rectangle. I assume there are no spaces in the input, output, and dead ring buffer.

Output:

a
b
dffffffff
g
i

Kill the ring:

c
e
h

But what I want to get is the output and kill ring.

Required Conclusion:

a
b
d
g
i

Desired kill ring:

c
effffffff
h

Is there any way to do this? Thank.

+4
source share
2 answers

cua-mode . cua-set-rectangle-mark, cua-copy-rectangle. cua-paste.

1) cua-mode, M-x cua-mode RET

2) cua-set-rectangle-mark ( C-RET)

rectangle selection with cua-mode

3) , cua-copy-rectangle ( M-w) cua-cut-rectangle ( C-w)

4) cua-paste ( C-y)

UPDATE. Emacs 24.4 ( ) cua-rectangle cua-mode, cua-rectangle-mark-mode.

+3

, :

  • M-x picture-mode.
  • , f.
  • : C-x r k.
  • C-c C-c. . , .
+1

Source: https://habr.com/ru/post/1530014/


All Articles