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
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-...
3
votes
3answers
704 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() { ...
28
votes
7answers
16k views

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 ...
2
votes
4answers
1k views

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 ...
1
vote
2answers
2k 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 ...
2
votes
1answer
523 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
57 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
76 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
286 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
108 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 ...
1
vote
1answer
214 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 ...
0
votes
0answers
357 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 ...
4
votes
2answers
2k views

Copy and paste between Emacs in an X terminal and other X applications

I am running Emacs in Gnome-terminal on Ubuntu. The way I know to copy and paste between emacs and other applications is by Ctrl+C and Ctrl+V, which I think is by the terminal emulator. A problem ...
2
votes
0answers
121 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
290 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, ...
1
vote
1answer
134 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 ...
2
votes
2answers
445 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
162 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
2k 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 ...
3
votes
1answer
185 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).
1
vote
1answer
654 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
3
votes
0answers
100 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
134 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
1answer
109 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 ...
1
vote
0answers
41 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
869 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. ...
1
vote
1answer
150 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
94 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?
5
votes
2answers
313 views

Alternative shortcuts to copy the character

To copy the character at point usually I do Shift-<right> M-w. I am wondering what are the alternative ways to do this action using only the Emacs standard keybindings (maybe with minimal ...
3
votes
1answer
910 views

How to set copy to C-c in Emacs?

I have tried using Cua mode (via adding (cua-mode t) to my ~/.emacs file) but it doesn't seem to set the copy keybinding to Ctrl-c. See for example this screenshot showing my Edit menu: I have tried ...
2
votes
0answers
257 views

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 ...
6
votes
4answers
457 views

Copy all file names that match regexp

In a dired buffer of a directory, how do I copy the file names of all files matching [tT]ypolog[yi]? Getting them from an elisp list format, \n separated format or otherwise into a python list format ...
4
votes
0answers
779 views

Emacs takes a very long time to read/save to the clipboard

Sometimes emacs takes a very long time (+ 30 seconds) to read from or save to the system (Linux) clipboard. The entire emacs session hangs while it does this and I can't cancel it with C-g or ESC ESC ...
0
votes
2answers
86 views

Copy and paste with mouse breaks Umlaute

After upgrading to emacs 24 I have strange problems with copy and paste. I managed to reinstall copy and paste with the mouse but there remains the problem with German diacritic characters. If I copy ...
2
votes
1answer
952 views

Copy and Paste From PDF to Emacs as Plain Text

Here is my problem: I often copy text from a PDF (let's say one that is nicely formatted or scanned cleanly) and like to post it in an active org-mode file I have for academic research. However, ...
4
votes
3answers
203 views

Copy a column of uneven width that ends with a specific character

I have a data file that looks as follows ALGO = Fast EDIFF = 6.7e-05 ENCUT = 520 IBRION = 2 ICHARG = 1 ISIF = 2 ISMEAR = 0 ISPIN = 2 I'm interested in copying the first column of uneven width but ...
2
votes
2answers
681 views

Remove tabs from pasted text automatically?

I have emacs configured to refrain from inserting tabs for indentation purposes already. But this does not have any effect when I paste text containing a tab (from an external application, Google ...
2
votes
2answers
135 views

Is it possible to get the start and end points in the buffer in which text is pasted?

Like if you have a buffer containing hel! and paste in lo world after the third letter you get 4 and 11 respectively? Emacs has many state variables, are there any that could help me in this case?
0
votes
1answer
34 views

One directional access to the clipboard (OS to Emacs: no, Emacs to OS: yes)

Is it possible that Emacs ignores the system clipboard? I mean when outside of Emacs I copy something, Emacs ignores it. But not vice-versa, i.e., I would like to be able to have the access to the ...
5
votes
1answer
457 views

How can I paste my password when pushing?

Instead of memorizing all of my passwords, I use a password manager to store them for me. Currently, since I use Magit for most Git purposes, I need to go through several steps in order to push: P P ...
8
votes
2answers
3k views

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

How to auto copy when a region is selected?

Chrome browser has an excellent extension called autocopy, which copies text whenever some text is selected/highlighted. To copy a region in emacs, I have to select the region and then press M-w to ...
1
vote
1answer
157 views

How to set mouse left click and hold to copy in helm-mode

I'm using helm-mode in emacs to open files. However, when I try to copy the path of a file (say /home/user1/Documents/file1.txt) to paste it in terminal, I get a message saying <down-mouse-1> ...
4
votes
1answer
289 views

Copy text as it is rendered by Emacs

I have Emacs doing a bunch of smart things to display text for me. In particular, some text has the invisible property set, and I'm running adaptive-wrap with <!-- adaptive-wrap-extra-indent: 3 --&...
5
votes
2answers
689 views

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?
3
votes
4answers
2k views

A quick way to copy the word before the cursor

By M-backspace (or by M-x backward-kill-word), I can remove the word before the cursor. Is there a built-in equivalent of this command for copying instead of deleting? Obviously one can do M-x ...
1
vote
1answer
49 views

How can select text in a single window in a multi-window configuration? [duplicate]

When I have two buffers open side by side in as terminal (as shown in the screenshot), I cannot simply select text in a single buffer for copy and paste purpose. The selection will span across them, ...
5
votes
1answer
230 views

Inadvertent paste when correcting spelling mistakes using flyspell

When I click with the middle mouse button that usually inserts the primary selection at the point where I clicked. However, the same button opens flyspell's context menu when I click on a misspelled ...
5
votes
2answers
3k views

Evil: Is there a default register that does not get overwritten by later yanks to explicit registers?

I often use registers in evil, but I have a common use case that I cannot seem to resolve. I would like to have all copied text stored somewhere that does not get overwritten when I explicitly make ...
7
votes
5answers
2k views

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?