Emacs: how to delete text without kill ring?

后端 未结 15 1073
旧巷少年郎
旧巷少年郎 2020-12-04 14:00

I\'d like to just delete some text so I can yank some other text instead of it. How can I do that? C-w cuts the selected text to kill ring and I end up with

15条回答
  •  借酒劲吻你
    2020-12-04 14:38

    I type M-x delete-region quite often, but you can bind it it to a key.

    With Delete Selection Mode in newer versions of Emacs you don't have to type a command just start typing:

    By default, text insertion occurs normally even if the mark is active—for example, typing a inserts the character ‘a’, then deactivates the mark. Delete Selection mode, a minor mode, modifies this behavior: if you enable that mode, then inserting text while the mark is active causes the text in the region to be deleted first. Also, commands that normally delete just one character, such as C-d or DEL, will delete the entire region instead. To toggle Delete Selection mode on or off, type M-x delete-selection-mode.

提交回复
热议问题