Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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

0
votes
0answers
8 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 ...
3
votes
1answer
65 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. ...
0
votes
0answers
8 views

Cygwin mintty cut will paste to notepad, but (sometimes) not to cygwin emacs. Why? mouse-yank-primary?

I'm running Windows 7, cygwin emacs-w32 26.1, and mintty 2.9.6. When I select text in mintty (using the mouse), and paste (using C-v) into Notepad (for example), it works the way I would expect it to....
2
votes
5answers
59 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
71 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
55 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 ...
2
votes
2answers
48 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
29 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
54 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
29 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
36 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 ...
1
vote
1answer
42 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.
3
votes
2answers
333 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
125 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 ...
2
votes
2answers
136 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.
0
votes
1answer
144 views

Evil - don't yank with only whitespace to register

How can I configure Emacs in the Evil mode to delete an empty line (d d) without copying it but still copy it when deleting a non-empty line? Thanks!
2
votes
0answers
754 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 ...
8
votes
5answers
1k 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), ...
0
votes
1answer
338 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?
0
votes
0answers
87 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 ...
1
vote
1answer
1k 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 ...
3
votes
0answers
46 views

Copy buffer content verbatim

Emacs uses overlays / prettify-symbols-mode / etc which modify how data is displayed to user. I like to copy visible content as I see it. For example I aligned columns in CSV file with M-x csv-align-...
2
votes
1answer
279 views

How to avoid term turn line wrap into line break for long output

When the output in term is longer than the frame it will wrap the line. But when I copy and paste the output, I found the output will break under the wrap point, because it treat it as line break. How ...
0
votes
1answer
39 views

Yanking line copies past kill-ring lines along with current

I'm using Emacs to create text to copy to another program, but I need to copy line by line. I'm using a variation of kill-ring-save I provide below. (defun my-kill-ring-save () (interactive) ...
1
vote
2answers
60 views

save-whole-line

kill-whole-line works as I want. It cuts the line, and when I'm in org-mode it cuts the whole collapsed subtree. What I need is just that as copy instead of cut. There is a multitude of suggestions ...
1
vote
1answer
128 views

How copy content of minibuffer to kill-ring?

Windows 10, Emacs 25, Helm How copy content of minibuffer to kill-ring?
0
votes
1answer
68 views

How to paste to another app from a shell script

I've been getting very vexed by the following. Goal: Take the clipboard contents and paste them into another application by using a shell script called by Emacs, followed by a Return. [This is for ...
2
votes
0answers
214 views

How to copy into mintty xterm clipboard from terminal emacs

My host machine is Windows, but I'm working in Linux virtualbox machine over ssh from mintty in MSYS2 environment. As you may know, in mintty you copy via C-insert and paste via C-S-insert. When I ssh ...
0
votes
0answers
222 views

Wanted: vim-like paste behavior from browse-kill-ring

When using the browse-kill-ring package to insert some text from the kill ring, the text always gets inserted before point. This is not intuitive to vim users who are used to pasted text being ...
2
votes
0answers
90 views

Copy/Paste relative links between buffers

How can I copy (relative) links and regions with (relative) links between buffers? Buffer c:\path\to\a\a.org contains links of the form * A section with links This is a link to another org-file [[...
1
vote
0answers
149 views

Evil paste behaviour

I'm noticing odd behaviour when I select some text with control-space and use p to paste -- in that the paste is done after the cursor character, rather than on the next line. Is that intentional, ...
0
votes
0answers
154 views

how to use google-translate directly in pdf-tools

google-translate and pdf-tools are two major mode which are common used in emacs for my daily tasks something puzzle me a lot is that any content in pdf-tools can't directly used in emacs you ...
1
vote
1answer
115 views

Copy Paste - Hard to use with one Hand

Coming from casual IDEs I used CUA mode. Switching back to the vanilla keymaps I noticed that M-w & C-y (copy&yank) is significant harder to use with one hand than Ctrl c & Ctrl v Why are ...
4
votes
1answer
603 views

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 (...
1
vote
2answers
237 views

Copying an rectangular selection to system clipboard

Does anyone know a command or somtething to copy an rectangular selection (as with C-x r M-w / copy-rectange-as-kill) and put the killed rectangle into the system clipboard like with the kill-ring-...
1
vote
1answer
143 views

Copy part of the file in the buffer

I need to copy part of the file (with re-search-forward) to another file under the marker. I know how to use re-search-forward, but I have problems with buffer. Am i right with my logic? 1) open ...
4
votes
1answer
114 views

Copy non-printable characters as displayed by Emacs

Very similar to this question: Copy text as it is rendered by Emacs but what I need is to coy the ^M, ^E and so on characters as they are displayed. (Otherwise the text in clipboard gets truncated).
0
votes
1answer
320 views

copy/paste text use pdf-tools in emacs

when I use pdf-tools the text in it can't be copy/paste as normal I want to treat this pdf mode as a place where I get the information to use in emacs
4
votes
0answers
82 views

copy to clipboard without overwriting kill ring

I'm looking for a way to copy to clipboard from emacs without passing through the kill-ring, moving the marker or using the mouse. If I use x-select-enable-primary and x-select-enable-clipboard, I can ...
0
votes
1answer
114 views

How can Emacs mouse capture in an X11 based terminal be disabled to enable copy and past?

I am using Spacemacs in a terminal in a desktop, ie Konsole and when I try to copy and paste I see that emacs is capturing mouse clicks. Is it possible to disable Emacs mouse capture for copying and ...
1
vote
2answers
441 views

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 ...
1
vote
2answers
899 views

copy paste from/to GUI Emacs not working — Windows 7

I have an issue with copy and paste from or to Emacs (GUI); as precised in the title, I'm using Windows 7. The Emacs version is 25.1.1 kill and yank are working properly though ; to copy or paste, I ...
0
votes
2answers
303 views

how to paste with indent

the code block I copy outside emacs, which is not auto-indent when yanking in org type org-return-indent -> yank code block -> indent manually: *** headline | v *** headline { code ...
3
votes
3answers
332 views

Evil mode: How to run evil-indent on the text I've just pasted

When I copy line three below in evil-mode function foo() { } var bar; #copy and paste it at line two, I get function foo() { var bar; #paste } instead of the correctly indented function foo() { ...
2
votes
1answer
78 views

How can i keep the case when I am using select and paste to C-s input field?

I see a word in buffer1. I want to look for it in buffer2. I select the word in buffer1. I select buffer2 as my current buffer, hit C-s, and press mouse-2 (the middle mouse button). Emacs converts ...
0
votes
1answer
108 views

Accidental yank or paste into org buffer

EDIT: I closed and reopened Emacs again and the same behavior happened. But this time the text inserted was from my last kill or M-w—(add-hook 'before-save-hook 'time-stamp)—to copy it to the system ...
2
votes
0answers
34 views

Is there a way to get copy & paste to be context-aware wrt whitespace and formatting?

When I copy a word and paste it at the end of an existing sentence (between the last word and the full stop), I'd like it to be pasted in such a way that the space between the pasted word and the ...
5
votes
2answers
555 views

Copy text as rectangle

This is the block of text that I intend to copy as rectangle (without the line numbers). 1. ALM_KRmet_DCDO_RPMP_START 2. ALM_KRmet_DCDO_RPMP_STOP 3. ALM_KRmet_DIDC_RPMP_TRIP 4. ...
0
votes
1answer
92 views

Get thing-at-point to include periods

I'm using avy to select and insert symbols on screen with the help of thing-at-point. Is there an obvious way to get this to include periods? At the moment if I select self.blah I get just self (or ...
1
vote
1answer
54 views

pasting from websites results in 1 long line..anyway to keep the paragraph format?

when copy and pasting from any web site a paragraph and pasting into emacs with S-insert, the paragraph is always a very long line. is there anyway to keep the paragraph structure?