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
2answers
63 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 ...
13
votes
1answer
2k views

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 ...
13
votes
1answer
5k views

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.
2
votes
1answer
476 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 ...
2
votes
1answer
1k 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 ...
5
votes
3answers
7k views

copy from shell and paste in terminal-emacs

How can I copy from the command line and paste in Emacs in terminal mode? If I select the text with the mouse and paste it from the clipboard with the third button (the wheel) it is OK. But if I try ...
1
vote
1answer
23 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 ...
0
votes
0answers
20 views

Copy/Paste in terminal with Evil mode is confusing

In GUI emacs if I have two lines: 1.test 2.test And I did yy on the first line. when moving to the second line and doing p, the end result is: 1.test 2.test 1.test However in terminal mode, ...
7
votes
4answers
1k 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 ...
0
votes
0answers
17 views

Duplicate draft in mu4e

I write a draft email in mu4e and want to re-use it for other recipients. I would like to copy everything in that draft to a new draft. I have not found a function completing mu4e-*duplicate. This ...
20
votes
1answer
3k views

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: ...
1
vote
2answers
74 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 (...
0
votes
0answers
33 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 ...
1
vote
1answer
56 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
3answers
667 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 ...
0
votes
0answers
57 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. ...
2
votes
2answers
405 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?
3
votes
1answer
460 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. ...
1
vote
1answer
61 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
12 views

Lines cut off when pasting into emacs from outside source

When I paste a large selection of text (over 100 lines) into an Emacs buffer (using Apple-C and Apple-V, not kill and yank), the end of the selection gets cut off. This doesn't happen when I use Nano ...
7
votes
2answers
1k 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 (...
4
votes
2answers
644 views

how to push kill-ring contents onto system pasteboard (clipboard)?

I use the brilliant answer from my previous question to copy selected regions of text from Emacs onto my system pasteboard (i.e. the OSX clipboard). But some functions (e.g. gist-buffer) push output ...
0
votes
0answers
16 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
464 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 ...
10
votes
6answers
5k 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), ...
7
votes
3answers
1k views

Copy region from emacs without newlines

I would like to be able to easily select a region of text from Emacs and then paste it into another app or browser - with all the extra fill-paragraph newlines removed so that the paragraph display in ...
3
votes
2answers
363 views

Pasting Text from Clipboard - why ^M instead of linebreaks?

I'm using some VBA scripts which copy Text in MS Outlook from an e-mail message and send it to the clipboard. If I then paste the clipboard content with Ctrl-Y in Emacs 24.5.1 in Windows 7, the ...
7
votes
4answers
3k views

How can I copy syntax highlighted code as RTF or HTML?

I'm using Emacs to write code samples that I later want to be able to paste into a MS-Word document, preserving the syntax highlighting. I understand that in order to do this I need to copy the text ...
0
votes
0answers
26 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 ...
32
votes
10answers
8k views

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-...
1
vote
5answers
249 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
2answers
277 views

Any way to select a region using `S-down-mouse-1` without saving the region as a kill?

Using emacsw32. The usual suggested way to make a selection using S-down-mouse-1 is to bind that to mouse-save-then-kill. Is there a similar command which selects a region, but does not save the ...
2
votes
3answers
325 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
68 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
123 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
46 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): ...
3
votes
2answers
1k views

How to turn off bracketed paste mode?

I saw that bracketed paste mode is automatically enabled in Emacs 25.1 running in a terminal. But I want to disable this mode. Because this mode adds text like 200~ 201~ to pasted text, bracketed ...
1
vote
2answers
57 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 ...
0
votes
1answer
81 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
61 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 ...
2
votes
1answer
54 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.
5
votes
1answer
272 views

Pasting text doesn't work properly in evil-/web-mode

In certain situations Emacs doesn't properly paste text. Apparently this only happens if the current buffer isn't saved and both web-mode and evil-mode are loaded. I was able to reproduce this ...
3
votes
3answers
195 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 ...
3
votes
2answers
345 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.
6
votes
3answers
3k views

How to select (and copy) a column of an org table *without* rectangle selection?

It seems to me that the normal way to copy a column of an org table is by rectangle selection (see here). That is, first the column is selected by marking all of it by hand, and then it is copied with ...
0
votes
1answer
1k 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
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 ...
0
votes
0answers
160 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 ...
7
votes
2answers
595 views

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.
4
votes
0answers
65 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-...