在将 Cua 绑定设置为 Ctrl+C 的区域上激活命令,以便在 Emacs 中进行复制
我想知道当 Cua 绑定打开时,如果突出显示的区域以 Ctrl+C 开头,如何在区域上实现命令。
例如,我想在 LaTeX 模式下突出显示四行文本,然后运行命令 Ctrl+C Ctrl+f< /kbd> Ctrl+b 将文本更改为粗体或斜体。有了 cua 绑定,它会立即复制区域,有没有办法在设置标记后选择区域,并在该区域上运行命令以在这种情况下正确运行。如果您在设置标记后直接运行该命令,则会将命令放置在适当的位置而不是在该区域上。
不确定这是否可能,但我喜欢 cua 绑定,并且只是偶尔执行上述操作,但只是想知道或者最简单的事情是否是删除 cua 绑定。
注意:我意识到通过下面的设置它可以正常工作,因为它不会通过副本停用该区域,并且实际上会继续命令并且不会在 Ctrl+C 处停止就像它被关闭一样。是否可以在复制后不设置保留区域的情况下执行类似的操作?
(setq cua-keep-region-after-copy t)
I was wondering how to implement a command on a region when highlighted if it starts with Ctrl+C when Cua bindings are on.
For example, I want to highlight like four lines of text in LaTeX mode and run the command Ctrl+C Ctrl+f Ctrl+b which changes the text to bold or italics. With cua bindings on it copies the region immediately, is there a way to select region after the mark has been set and say run the commmand on this region to operate correctly in this case. If you just run the command straight after setting the mark it puts the command in place not on the region.
Not sure if this is possible but I like the cua binding and only do the above occasionally but was just wondering or if the easiest thing is removing the cua binding.
Note: I realized with the below set that it works correctly because it doesn't deactivate the region with a copy and actually continues commands and doesn't stop at Ctrl+C like with it turned off. Is it possible to do something similar without setting keep region after copy?
(setq cua-keep-region-after-copy t)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以将 cua-exchange-point-and-mark 与前缀参数一起使用,例如
这:
C-space (设置标记)
C-e(转到行尾)
C-c (复制文本)
C-uC-xC-x
(交换标记处的点并激活标记)
C-cC-fC-b
You can use
cua-exchange-point-and-mark
with a prefix argument likethis:
C-space (set the mark)
C-e (goes to the end of the line)
C-c (copy the text)
C-uC-xC-x
(exchanges point at mark and activates the mark)
C-cC-fC-b
这与按下 cua 键绑定后按下另一个键的速度有关。如果突出显示任何您快速按下与 cua 绑定键绑定的键,它将激活该区域上的命令。我认为默认值是 0.2 秒或者相对较快的时间。如果您想将其设置得更长或更慢,则更改此设置的变量:
cua-prefix-override-inhibit-delay:
This has to due with the speed you press another key after pressing a cua key binding. If highlighted any you press a key binding with a cua binded key really fast it will activate the command on the region. I think the default is like 0.2 seconds or something relatively fast. The variable that changes this if you want to set it longer or slower:
cua-prefix-override-inhibit-delay
: