How to replace a region in emacs with yank buffer contents?

后端 未结 7 2069
一向
一向 2020-12-24 05:26

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 on

7条回答
  •  一个人的身影
    2020-12-24 06:09

    Setting delete-selection-mode, as Michael suggested, seems the most natural way to do it.

    However, that's not what I do :) Instead, I put the good stuff into a "register" -- for example, register "a" -- with C-x r x a. Then I kill the other copy, and copy the register into the same spot with C-x r g a.

    This is convenient because killing doesn't affect the registers, so C-x r g a always inserts the good stuff.

提交回复
热议问题