Emacs: Sync Copy/Paste Clipboards with Linux X11
In Linux, if copy/paste doesn't work with other apps, you can add this:
;; after copy Ctrl+c in Linux X11, you can paste by `yank' in emacs (setq x-select-enable-clipboard t) ;; after mouse selection in X11, you can paste by `yank' in emacs (setq x-select-enable-primary t)
In X11, there are 2 major copy/paste mechanisms:
- ① primary selection. When you select a text using mouse, the text is automatically put into the primary selection, and middle click will paste it.
- ② clipboard. X11's clipboard is similar to the clipboard in Mac or Windows. You copy/paste by menu or keyboard.
The primary selection and clipboard are independent.
References:
- (info "(elisp) Window System Selections")
- X Selections, Cut Buffers, and Kill Rings ~ By Jamie Zawinski. At http://www.jwz.org/doc/x-cut-and-paste.html
- X Window selection
If you want to sync X11's “primary selection” and “clipboard” always, see: Linux: Sync X11 Primary Selection and Clipboard
Copy/Paste Topic
- Emacs: Copy/Paste and kill-ring History
- Emacs: Copy/Cut Current Line If No Selection
- Emacs: Copy/Cut All or Selection
- Emacs: Paste or Paste Previous
- Emacs: Show kill-ring
- Emacs: Copy to Register
- Emacs: 1 Key to Copy/Paste from Register
- Emacs: Copy Append
- Emacs: Copy Rectangle Region to kill-ring
- Emacs: Sync Copy/Paste Clipboards with Linux X11
Patreon me $5. Ask me question on patreon