I use GNU Emacs 25.1.1. I use it in terminal mode. In GUI Mode I know how to copy and yank. In terminal mode, copying and pasting from another application works but not the usual keybinding.
Usually C-y is for yank inside emacs but in my terminal mode C-Shift-V only works for yanking.
But when I try to copy from emacs to another shell or application it doesn't copy.
I don't want to use mouse for copying and yanking.. Is there any workaround? What Am I doing Wrong?
In "terminal mode", you're not really interacting with emacs. You're interacting with your terminal or terminal emulator.
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.
That's also why pasting large text through terminal in emacs is slow : the terminal "get" the text and "redirect" it to emacs.
So, if you want to select, copy and paste text without the mouse, you'll have to configure your terminal.
Here's an example
You might like to try xclip-mode
(available from GNU ELPA), which relies on externals programs (xclip
under X11, and pbcopy
on macOS) to let Emacs communicate with your GUI (for things like C-y and C-k) even though it's running inside a text terminal.
I do this by using shell-command-on-region
along with the command-line pbpaste
/pbcopy
on my macOS box. Bind it to a key if necessary:
(global-set-key "\C-cr" (shell-command-on-region (point) (mark) "pbcopy"))
There are similar command-line programs you can use for Windows (https://github.com/ghuntley/pasteboard) and Linux (xsel
/xclip
).
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