I have (cua-mode t) in my .emacs, so that C-c is copy and C-v is paste just like most other programs on my desktop (Ubuntu, Gnome, Linux). However, Emacs does not seem to share the clipboard/copy buffer with other programs.
For example, if I C-c in Firefox I can S-C-v to paste into a terminal or C-v to paste into gedit. However, if I C-v (or C-y) in emacs, I do not get what I copied from Firefox.
Is there any way to make this work? Is there another command I can use to access the system's copy-paste buffer?
To cut the text, press C-w . To copy the text, press M-w . To paste the text, press C-y .
An Emacs copy is the command kill-ring-save (usually bound to M-w ). A system copy is what you typically get from pressing C-c (or choosing "Edit->Copy" in a application window). An X copy is "physically" highlighting text with the mouse cursor. An Emacs paste is the command yank (usually bound to C-y ).
When you copy and paste text, the terminal does it : you're taking the text that the terminal displays and not the text that is in your emacs app. That's why you have to use terminal keybindings : Ctrl-Shift-C and Ctrl-Shift-V to copy and paste text.
Use C-S-Backspace (kill-whole-line) instead of C-k. You don't have to screw with cursor position or killing the newline.
I had the same problem. I added this to my .emacs file:
(setq x-select-enable-clipboard t) (setq interprogram-paste-function 'x-cut-buffer-or-selection-value)
Now Ctrl-C and Ctrl-v between Emacs and other applications work fine. Source: Ubuntu Forums
See clipboard-yank
and clipboard-kill-region
in the clipboard section of the manual.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With