简体   繁体   中英

How to force emacs's pasting to behave like in other apps

I am new emacs user and one of the things that irritates me is that when I want to replace current selected text with the one from clipboard I need to delete it first. Every other application that I know replaces pasted text with the current selection by default.

Here's a little bit more detailed description:

  1. Select some block of text
  2. Paste text from clipboard
  3. Emacs just pastes text where the cursor was and previously selected text it is still there. I want that selected text was deleted first.

As artscan wrote in a comment, you can get this functionaly for the normal yank (paste) operations by adding:

(delete-selection-mode 1)

to your configuration.

If you want yank by mouse to also delete the current selection, you can add:

(put 'mouse-yank-primary 'delete-selection 'yank)

in your configuration as well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM