如何用yank缓冲区内容替换emacs中的区域? [英] How to replace a region in emacs with yank buffer contents?

查看:98
本文介绍了如何用yank缓冲区内容替换emacs中的区域?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用VIM或大多数无模式编辑器(Eclipse,NetBeans等)时,我经常执行以下操作。如果我有类似的文本块,我需要更改它们,我将更改一个,复制它(或使用非删除的yank),选择下一个块我需要并粘贴更改的版本。如果我在emacs中做同样的事情(选择区域并用C-y粘贴),它不会替换该区域,它只是粘贴在光标位置。在emacs中做什么?

解决方案

将此添加到您的 .emacs

 (delete-selection-mode 1)
pre>

在该区域处于活动状态时,写入缓冲区的任何东西都将覆盖它,包括粘贴,也可以简单地输入某些内容或者点击退格键

When I use VIM or most modeless editors (Eclipse, NetBeans etc.) I frequently do the following. If I have similar text blocks and I need to change them all, I will change one, copy it (or use non-deleting yank), select next block I need and paste the changed version over it. If I do the same thing in emacs (select region and paste with C-y), it doesn't replace the region, it just pastes at the cursor position. What is the way to do this in emacs?

解决方案

Add this to your .emacs:

(delete-selection-mode 1)

Anything that writes to the buffer while the region is active will overwrite it, including paste, but also simply typing something or hitting backspace

这篇关于如何用yank缓冲区内容替换emacs中的区域?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆