Questions tagged [copy-paste]

is about the editor operations cut, copy, and paste as they apply to Emacs. In Emacs, cut is called "kill" and paste is called "yank" (but Emacs enhances the standard cut and paste behavior).

Emacs manual and help (documentation strings) generally use the terms killing and yanking for cutting and pasting. The manual speaks of copying, cutting, and pasting when it mentions interoperating with the underlying operating system's using the and the .

146 questions
33
votes
10 answers

Kill or copy current line with minimal keystrokes

I do C-a C-k C-k to kill the entire line point is on. If I want to copy the line instead of killing it, I can hit C-/ C-/ right after typing the sequence above. Alternatively, I can do C-a C-SPC C-n M-w. Is there a faster way to kill or copy the…
itsjeyd
  • 14,586
  • 3
  • 58
  • 87
33
votes
7 answers

Copy text from Emacs to OS X clipboard

When I run Emacs in a text terminal instead of the normal GUI mode, I can copy in Emacs by activating the start of a region with C-SPC, and then select what I want, and then do M-w. Is there any way to get a region copied this way be available in…
Galder Zamarreño
  • 1,527
  • 2
  • 12
  • 21
28
votes
2 answers

Add operating system clipboard to kill ring

Often I find myself copying a code snippet into my operating system's clipboard from the internet. Then, I take the following simple steps: Switch to my Emacs window Find the place where I want to paste the code Use C-y (yank) to insert the copied…
nispio
  • 8,175
  • 2
  • 35
  • 73
21
votes
1 answer

evil-mode visual selection copies text to clipboard automatically

Setup: GUI version GNU Emacs 25.0.50.1 (x86_64-w64-mingw32) of 2015-07-25 on KAEL Compiled from EmacsW64. Package Evil, using the latest version of Evil from MELPA Windows 7 x64 bit. Situation: Tested with empty Emacs configuration with only Evil…
ReneFroger
  • 3,855
  • 22
  • 63
18
votes
1 answer

Spacemacs: paste into minibuffer

Is there a way to paste something into the minibuffer? For example if I want to eval-expression and paste something in there neiter C-v or (obviously p) will work? There has to be a way.
sebastian
  • 417
  • 3
  • 9
18
votes
4 answers

Org mode - Parsing rich HTML directly when pasting?

Currently, for notetaking tools like Evernote and Quiver, I can directly copy HTML content from my favorite browser and then paste them into the app, with all the formatting + link preserved. However in orgmode it seems that all the formatting info…
xji
  • 2,545
  • 17
  • 36
17
votes
7 answers

Simple ways to copy/paste files and directories between dired buffers

Is there a simple M-w C-y approach to copy paste files and directories between two dired buffers? I mean marking some items (files and buffer) by m then copying them by M-w (or another shortcut), then going to another dired buffer (which is not…
Name
  • 7,689
  • 4
  • 38
  • 84
10
votes
3 answers

Evil-emacs: how to select last pasted text (like gv)?

How do I visually select the last pasted text with evil-emacs? gv reselects the last visual selection. I'd like a function/snippet that does the same for my last pasted text.
The Unfun Cat
  • 2,393
  • 16
  • 32
10
votes
3 answers

How to access os clipboard using Emacs + Evil

How can i yank to/from windows clipboard when using: Windows 7 (x64) GNU Emacs 24.4.1 (x64) Evil 1.0.9 and having (setq x-select-enable-clipboard nil) in my .emacs? (I put this line there because i didn't want vim changes (x, d, etc) to clobber my…
Kossak
  • 1,159
  • 1
  • 9
  • 18
9
votes
2 answers

How to change octal sequences into utf-8 text

When I copy non-ascii text from Windows and paste into Emacs, it shows up as an octal sequence. For example, if I paste ä into Emacs it shows up as \344. I could type C-q 344 to get the ä back in Emacs. That's annoying, but it's tolerable if there's…
9
votes
3 answers

How do I cut and paste effectively between applications while using EXWM?

For example, I am trying to copy the URL line from Firefox into an org mode buffer. The usual cut and paste keys for Firefox (C-c C-v) do not work, and neither does (M-w C-y). To copy from Firefox (in this example), I have to use the right mouse…
Andomonir
  • 103
  • 5
9
votes
1 answer

How can I copy and paste characters displayed with compose-region?

I use several modes that display Unicode characters in my code without changing the underlying file. For example, in Haskell mode, the following code: foo :: forall a. Eq a => a -> a -> a gets displayed as foo ∷ ∀ a. Eq a ⇒ a → a → a This is…
Tikhon Jelvis
  • 6,152
  • 2
  • 27
  • 40
8
votes
3 answers

Pasting images from clipboard into Orgmode

I have seen some posts on this but I decided to ask anyway since this is an important feature many users are requesting: the ability to copy an image from eg., Chrome and paste it into Emacs Orgmode buffer. Is this possible in 2022?
8
votes
4 answers

Fastest way to move code block to specific line

Say you have code on lines 4, 5, 6. Then you want to move this block of code to starting point line 9 while also deleting lines 4, 5, 6. What's the fastest way, i.e. least amount of key strokes, to achieve this? Would a custom function be better…
c-o-d
  • 910
  • 9
  • 19
8
votes
4 answers

Copy/paste between SSH terminal Emacs and macOS

Suppose you are working in macOS, and you decide to SSH into a Linux box and fire up terminal Emacs. How do you copy and paste between macOS and your SSH terminal-Emacs? Copying and pasting between macOS and local terminal-Emacs is not a problem…
aparkerlue
  • 317
  • 2
  • 8
1
2 3
9 10