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 .

148 questions
8
votes
2 answers

How to get contents of current line?

I want to get contents of the current line(the line with cursor) for my function. What command allows me to achieve this?
MatthewRock
  • 1,483
  • 13
  • 28
6
votes
5 answers

How to paste text that had been copied (alt-w) prior to my latest paste (ctrl-y)?

Once I have selected some text I use Alt-w to copy the region and then use ctrl-y to paste it. Is there a way to paste something I have selected and copied with Alt-w prior to my latest paste?
Vass
  • 723
  • 1
  • 5
  • 13
4
votes
2 answers

How to copy text from another application to emacs in ubuntu?

I am using emacs 23.3 on Ubuntu 12.04 LTS. I am having problems trying to copy text from another application (most of the time, Firefox) to emacs. Sometimes it works and sometimes it doesn't. Any way to fix this? Thanks
Nirjhar Alam
  • 41
  • 1
  • 2
3
votes
0 answers

How do I get the highlight region mouse and yank functionality work like Emacs 21.3 in a newer version?

Recently at work (a small academic department, absolutely no Emacs support) we upgraded from Emacs version 21.3.1 to 24.3. In version 21 marking a region with the mouse will put the highlighted text into the kill-ring. Highlighting another region…
2
votes
2 answers

ctrl+backspace overwrites copy buffer

When I copy something first and then want to paste after I delete something, if I delete with CTRL+Backspace it pastes what I deleted when I CTRL+V (I can copy with CTRL+C and paste with CTRL+V in emacs). How can I configure emacs to paste what I…
efe373
  • 19
  • 2
2
votes
2 answers

Function to copy the whole line if no region is selected

I want to bind this function to M-w, so that it copies the region if one is selected, otherwise it copies the whole line silently, without having any other side-effects like moving the cursor to some other places. I saw some examples, but they all…
Bite Bytes
  • 291
  • 1
  • 8
2
votes
4 answers

Copy multiple lines?

The command kill-whole-line does just what it says. With a prefix argument, it allows me to kill multiple lines at the same time. How can I get the same functionality, but with copying instead of killing?
CodyChan
  • 2,649
  • 1
  • 21
  • 35
1
vote
0 answers

How can I paste text from the system's xopy-paSTE buffer (for instance, from a web browser under Linux) into Emacs Evil-mode?

I was sure this question had already been asked, but I couldn't find it on this SE. I would like to paste text from Chrome's view page source, on Cinnamon on Linux Mint, into an Emacs window. The menu has paste options, but they do not seem to be…
1
vote
0 answers

How can I copy out of emacs in terminal emulator with Wayland?

I often run Emacs in terminal emulator by emacs -nw. When using Wayland/Sway, how can I copy a text region out of Emacs to another window? When I use Ubuntu with X, I can do that by selecting the region, then M-| and typing xsel -bi.
Ben
  • 11
  • 1
1
vote
1 answer

How do I cut and paste raw bytes in emacs?

Here are some raw bytes shown in emacs that are printing correctly: I can see that those are the actual bytes with od -bc on the command line: When I use control-space to mark, control-w to cut, and control-y to yank, it drops something…
dfrankow
  • 111
  • 3
1
vote
1 answer

emacs -nw mode, when you paste in some text from another application emacs sometimes misses parts or stops halfway. how can I mitigate it?

In macOS in emacs -nw mode, when you paste in some text from another application emacs sometimes misses parts or stops halfway. Often I see a tilde as the last character entered, when there wasnt even a tilde in the incoming text. I read somewhere…
american-ninja-warrior
  • 3,903
  • 2
  • 24
  • 44
0
votes
1 answer

Copy text at line N at point

How can I make a function that copies text from line number N at point? I will be at some specific line and point position and want to copy the text from a different line N.
Dilna
  • 1
  • 3
  • 11
0
votes
1 answer

Copy Current Line

This code copies the current line: (defun copy-line () "Copy the whole line that point is on." …
Jason Hunter
  • 709
  • 4
  • 10
0
votes
1 answer

Emacs or Spacemacs

Trying to understand who to copy/paste between Spacemacs or Emacs and terminal and browser. Using Spacemacs with Ubuntu 16.04 presently Tried configuring xcopy and confused about it. Can’t seem to yank and paste or copy and paste or middle click…
Emil
  • 1