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).

Filter by
Sorted by
Tagged with
1
vote
0answers
23 views

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 ...
0
votes
0answers
54 views

Easiest way to copy an inline image from org mode to clipboard in Doom emacs

Easiest way to copy an inline image from org mode to clipboard. I tried ox-clip, but when hovering over the image i get: funcall-interactively: Symbol’s value as variable is void: org-html-inline-...
0
votes
0answers
30 views

Pasting from vim to a buffer of emacs

I am rocking quite an idiosyncratic workflow that combines both vim and emacs in a tmux session, on an ssh server. The problem is, if I try to copy (y) something from a (neo)vim buffer and paste in an ...
2
votes
2answers
80 views

Deleting words while preserving clipboard

Is there a way to keep the clipboard contents when deleting entire words with M-DEL? For instance, I'd like to delete a word (M-DEL) and then paste (C-y) what I had previously copied (with ctrl+c) ...
1
vote
1answer
39 views

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 ...
0
votes
0answers
12 views

Can't paste into org-roam link creating interactive process

When I create a link in org-mode, I do C-l and this starts an interactive process. The first step asks for the link: I used to be able to paste into this interactive prompt but now I cannot. If I ...
0
votes
1answer
111 views

Possible to copy-paste without markup in Org-mode?

You can add inline code and verbatim text in Org-mode using this syntax: ~<code>cd ~~</code>~ =verbatim /text/= This is expected to display: <code>cd ~</code> verbatim /text/...
0
votes
1answer
42 views

quote copy/paste keys bindings

how can I copy a quote and paste it onto an emacs file? the shortcuts please?. I have tried to type the text but it is too long to write by hand.
1
vote
1answer
39 views

How can I prevent pasting after org-copy-visible leaving cursor at end of text?

In evil-mode, if I use 3yy to copy three lines, then move somewhere else in my file and do P (evil-paste-before), the three lines are pasted before the line with the cursor, and the cursor is left at ...
3
votes
1answer
155 views

How can I copy+paste `org-mode` headlines only?

I have an org-mode file containing a structure like this: *** H1 **** H2 - Foo Foo **** H2 Foo Foo I would like to make a copy of H1 and all it's subheadings, but none of the non-headline content. ...
1
vote
1answer
148 views

How to copy commit hash from Magit status buffer?

After I open a Magit status buffer and make a commit, I commonly also want to copy that commit's hash (the shortened version) to my clipboard to post somewhere else. I can't work out how this should ...
1
vote
3answers
77 views

How to yank character under cursor?

I want to copy just one character underneath the cursor. Its not ascii, so I can't type it. Is there a function or key that allows for this? Vanilla emacs welcome, though evil and spacemacs answers ...
0
votes
0answers
87 views

Copy/Paste&Cut with Spacemacs on Terminal

I'm new with emacs, and I'm a developer that uses IDE to develop, and I want to learn emacs. I choose Spacemacs as customization because I think has a good keybinding for me, but now I miss a feature ...
0
votes
0answers
35 views

Why is a TAB character added when using kill-rectangle and yank-rectangle to insert multiple rows into an org-mode table?

I noticed an annoying behaviour when copying multiple rows (a list) from a web page into an org-mode table, following a process inspired by Is it possible to copy /paste multiple lines of text into ...
0
votes
0answers
167 views

Copy/Paste (yank) problems with emacs in WSL2 with VcXsrv (from clipboard)

I have two problems with emacs when I'm using it with WSL2 and VcXsrv. When I copy something out of emacs and paste/yank it in a buffer, it usually works smoothly except for two cases: If I select ...
2
votes
1answer
96 views

Binding XF86Cut and XF86Copy to Emacs Commands

I have a keyboard with dedicated keys for XF86Cut, XF86Copy, XF86Paste. I want to bind these to Emacs commands. The goal is get the usual behavior for cut-and-paste between Emacs, my terminal, and my ...
1
vote
2answers
336 views

Remove everything except match of regexp?

I have a file with a structure like: some text and numbers and a final number: 1.213,31 some other number 1231 and text again some text and a final number: 53,00 something else again a final number: ...
0
votes
1answer
77 views

Prompt for stdin via `shell-command`

Sometimes when I copy+paste into my spacemacs over SSH, I get some random garbage that seems to be due to spacemacs interpreting some of the pasted content as commands. In vim, my workaround is to run ...
0
votes
1answer
102 views

Cannot paste text copied from Emacs to synchronous subprocess

TL;DR When trying to paste text copied/killed in Emacs to another program while Emacs is waiting for a synchronous subprocess to finish, the target program hangs until Emacs becomes responsive again. ...
0
votes
1answer
64 views

Paste into org-mode: utf-8-unix cannot encode \207 for á, \222 for í

I'm learning emacs (on spacemacs) and focusing on orgmode. When I paste into an org-mode buffer from a non-english language that contains accents and other signs (in my case italian and spanish) I get:...
0
votes
1answer
114 views

How to overwrite by pasting a string without selecting a region?

I can't figure out how to paste a string, for example 145 characters long, into a text line in a way, that the next 145 characters after the string are overwritten by this string or simply erased. An ...
2
votes
2answers
263 views

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 ...
1
vote
1answer
48 views

kill-ring-save rectangle and paste transposed?

Suppose I have some code written like: a_to_b = self.tversky(a, b) b_to_c = self.tversky(b, c) d_to_e = self.tversky(d, e) e_to_f = self.tversky(e, f) g_to_h = self.tversky(g, h) I would like to ...
1
vote
2answers
166 views

How to copy the symbol name at point?

I want to copy the name of the symbol at point, without using the mouse. (global-set-key (kbd "C-s C-c") '<copy_word>) Possible word marking as i-search does on the following example usage (...
2
votes
1answer
146 views

Encrypt excerpts in org file (passwords only)

I keep project info in .org file together with passwords. When I share a screen it is annoying to show passwords in a buffer accidentally. I want to keep .org file in plain text format but mark some ...
0
votes
0answers
80 views

Pasting text into Emacs but preserving empty lines between paragraphs

When I copy text from another application and paste it into Emacs it removes all formatting including the empty lines between paragraphs. I would like to paste into Emacs and preserve the empty lines. ...
1
vote
1answer
89 views

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 ...
1
vote
1answer
120 views

Copy to PRIMARY selection in command

I'm a novice in Lisp, so I feel like I'm missing something very basic here. My intention was to create a function/shortcut to remove all whitespace and newline chars from the selected text and copy ...
0
votes
0answers
20 views

emacs breaks down text snippet copied from another X Window application

When I select with a mouse a block of text in Firefox or VIM for example, copy it and then try to paste in Emacs, it gets pasted, but unaligned, meaning that beginning of the lines shift away to the ...
1
vote
2answers
822 views

Ctrl c Ctrl v copy paste in multi-term

I want to be able to copy paste using C-c and C-v when I edit a file and in multi-term. After more than a few hours I gave up. I would be thankful if anyone could tell me what the recommended way for ...
0
votes
0answers
34 views

emacs in putty session on fedora under virtual box on windows 10 hangs on X11 paste

I suffer a rangy environment where I typically will run emacs in a putty session on fedora under virtual box on windows 10. Sometimes (not all of the time), pasting into the emacs will hang the ...
4
votes
1answer
777 views

Almost working smoothly attempt to get terminal Emacs to copy to clipboard

I'm running this emacs GNU Emacs 25.2.2 (x86_64-pc-linux-gnu) of 2017-09-22, modified by Debian directly in a Gnome terminal by calling emacs, which is actually a link to /etc/alternatives/emacs. ...
2
votes
5answers
604 views

Copy-paste text among Split Window Buffers

Say I have split my main Emacs Window into 2 : LEFT and RIGHT. My cursor is currently in LEFT. How do I copy some text from LEFT to RIGHT without going to the RIGHT window?
2
votes
3answers
601 views

How can I copy text from read only buffer?

When read the org mode manual to provide support for the raised question. The contents in read-only buffer is causally need to be copied as reference here. Take the Org Capture Template as an ...
1
vote
2answers
85 views

Emacs equivalent of 'y%'

In normal mode in Vim, one can use y% to copy text between matching parenthesis. y starts the yanking command and % selects the matching closed or open parenthesis. What is the Emacs equivalent of ...
1
vote
2answers
286 views

Convert tabs to spaces when copying text to external applications

I use tabs in C/C++ but want to convert those tabs to spaces when copying code that I'm going to paste into an external program. However, I want the original code to retain tabs. Additionally (if ...
1
vote
1answer
66 views

Query replace a copied string by another copied one

Use case: I want to: copy a (long, not handy to manually type) newstring, replace all occurrences of another (long, not handy to manually type) string by newstring. Current process (not handy): ...
0
votes
1answer
94 views

Emacs or Spacemacs [duplicate]

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 ...
0
votes
1answer
96 views

Can I copy a date from M-x calendar into kill ring or buffer

I would like to be able to run M-x calendar, navigate to a date, press some keystroke which would do one of the following: place the selected date onto the kill ring or close the calendar and ...
1
vote
2answers
66 views

Inside isearch how to get mouse-2 clicked inside a frame to paste into echoarea?

When I search with C-s, I can paste a search term (copied outside of emacs frame) with either M-y or mouse-2 click focused inside echoarea. In xemacs it is enough to mouse-2 click inside the main ...
2
votes
1answer
60 views

How to select last pasted text

How can I select the last pasted text with regular Emacs? I would like to do the same thing as this Q&A, but I don't use evil mode.
8
votes
4answers
2k views

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 ...
3
votes
3answers
222 views

How to paste-then-copy?

I'm not sure whether anyone has ever implemented what I'm looking for, but maybe I'm just using the wrong terms to search for it. What I want to achieve is essentially a reverse copy and paste: I'm ...
4
votes
2answers
625 views

How can I yank images from Emacs?

I want to copy images from Emacs to macOS clipboard. I have tried selecting them and yanking, which hasn't worked. Google also didn't have a solution.
2
votes
2answers
630 views

Evil - don't yank with only whitespace to register

How can I configure Emacs in Evil mode to delete an empty line (d d) without copying it but still copy it when deleting a non-empty line?
2
votes
2answers
3k views

Copy/paste from Windows clipboard in WSL terminal

I know that question has been asked dozens of times now, but i have tried every possible suggestion i have found online - nothing worked. I can't figure out how can I copy/paste from my Windows 10 to ...
15
votes
7answers
8k views

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), ...
1
vote
1answer
2k views

How to copy paste in OSX terminal in emacs?

According to the cheat sheet of Emacs, M-w to copy a highlighted text and C-y to paste it. M-w means command w which ultimately tries to kill the terminal?
1
vote
0answers
480 views

How to use Org pretty math expressions with clipboard?

Using org-toggle-pretty-entities, org-mode will convert text like ∫_ℝ f(x)dx = 1 ∑^N_{i=1} x_i to But if I want to copy that text to an outside application, it just shows up as it was originally ...
2
votes
1answer
2k views

How to better manage the copy/cut/paste shortcuts between emacs and the macOS clipboard?

I'm running spacemacs v.0.200.9 on emacs v.25.1.1, on macOS 10.11 and 10.12. And I'm not happy with how the clipboard works between the OS and emacs. Here's the behaviour I'd expect: [X] Cmd + c in ...