将矩形选区的形状保存在 Emacs 寄存器中
我需要从固定大小的矩形区域重复复制文本,并且希望能够将该矩形区域的形状保存在寄存器中,这样我就不必继续重新创建相同的大小。
cua-set-rectangle-mark
(
)移动点以创建 8x16 区域(注意:这是我要删除的步骤)
piture-clear-rectangle
(Cc Ck
)将点移动到新位置。
图片复制矩形
(抄送 Cy
)
我想用单个“从寄存器粘贴矩形区域”命令替换步骤 1 和 2。这可能吗?
I need to repeatedly copy text from a fixed size rectangular region and I'd like to be able to save the shape of that rectangular region in a register so I don't have to keep re-creating the same size.
cua-set-rectangle-mark
(<C-return>
)Move point to create a region 8x16 (note: this is the step I want to remove)
piture-clear-rectangle
(C-c C-k
)Move point to new location.
picture-yank-rectangle
(C-c C-y
)
I'd like to replace steps 1 and 2 with a single 'paste rectangular region from register' command. Is this possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
只需使用键盘宏来实现此目的不是更容易吗?
例如:-
然后
Wouldn't it be easier to simply use a keyboard macro for this?
E.g.:-
Then
您可能想使用
copy-rectangle-to-register
和insert-register
:插入寄存器:
另请参阅:
Cxrc:
clear-rectangle
Cxrd:
删除矩形
Cxrk:
杀矩形
Cxro:
开放矩形
Cxrr:
复制矩形到寄存器
Cxrt:
字符串矩形
Cxry:
yank-rectangle
编辑:
是的,我完全误解了这个问题。
如果您仍然特别想使用寄存器,您可以保存并重新执行点移动,如下所示:
You probably want to use
copy-rectangle-to-register
andinsert-register
:insert-register:
See also:
C-xrc:
clear-rectangle
C-xrd:
delete-rectangle
C-xrk:
kill-rectangle
C-xro:
open-rectangle
C-xrr:
copy-rectangle-to-register
C-xrt:
string-rectangle
C-xry:
yank-rectangle
EDIT:
Right, I completely misunderstood the question.
If you still particularly want to use registers, you could save and re-execute point movements with something like this: