Questions tagged [yank]

Emacs' name for 'paste' (the one that goes together with copy).

Filter by
Sorted by
Tagged with
1
vote
3answers
51 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
1answer
27 views

How to modify text that's yanked?

I copy text from websites and paste/yank into emacs buffers. But this text sometimes has silent hyphens in them. The behaviour when copying and pasting text with soft hyphens in it varies across ...
1
vote
1answer
27 views

How to have yank visually flash the pasted text

I'd like to be able to paste text into a buffer and have emacs give a visual confirmation by flashing the region (highlighting and unhighlighting) the text that was pasted in the buffer. Is there an ...
0
votes
0answers
33 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 ...
0
votes
1answer
33 views

Spacemacs, Lisp, Pasting and the missing Space

When editing Lisp or Clojure in Spacemacs (Emacs with Evil) I find the pasting behavior anoying. Say I have yanked bar and want to paste it as a parameter to (foo) so I get (foo bar). The problem is, ...
2
votes
2answers
70 views

Removing unwanted colors (and other decorations) from yanked text

I have a Java properties file that, when opened with Emacs, shows up in a color coded form, as below: I also have a simple text file. When I yank something from the properties file into the text file,...
0
votes
2answers
119 views

Possible to access the second-last clipboard contents (clipboard history)

Is there a way to access the second last value of the clipboard in Emacs? I assume it's possible to make this work within Emacs. Intercept the copy function. Read the clipboard and add it to a list. ...
1
vote
1answer
32 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
1answer
60 views

Yanking does not use top entry in the kill ring

I want to delete regions without adding them to the kill ring following this thread: (defun backward-kill-word-no-kill-ring () "Delete the previous word and remove it from the kill ring." (...
0
votes
1answer
75 views

wrong-type-argument from insert yank

I'm looking for ways to get the last copy from the kill ring in Emacs. I run (insert (yank))[cursor] with C-x C-e and I get this *Backtrace*: Debugger entered--Lisp error: (wrong-type-argument ...
1
vote
2answers
233 views

How to save clipboard or (car kill-ring) as string

OS Debian GNU/Linux 7 emacs-24.3 I want to save the content of the clipboard or the last item of the kill-ring (depending whats newer) as a string so that I can do stuff with it in a eLisp function. ...
4
votes
1answer
119 views

How to stop web-mode from reindenting after yank?

I'm editing this code: callFunction({ x: somearray, }); Then I want to extract somearray to be a variable with a copy. I cut somearray and delete the colon, then enter (_ is the cursor): const ...
1
vote
1answer
42 views

Highlight yanked region during sequence of yank-pop's until mark is moved away

I sometimes find myself yanking a large chunk C-y and then cycling M-y through some previous kills. This can feel visually noisy to me, i.e. during the sequence of replaces it's easy to lose track of ...
1
vote
2answers
103 views

Rotate the yanking ring

I have such a table | C | M | |---------------------+---------------------| | Character | Word | |---------------------+----------...
0
votes
1answer
51 views

Why isn't the flushed output from my Emacs shell buffer getting into the kill ring?

Following the advice given on p. 121 of Learning GNU Emacs, 2nd Ed., I'm entering the command sequence: C-c C-o, immediately after executing a command in my Emacs shell buffer. And I'm seeing the ...
0
votes
1answer
95 views

Using a predefined Regex on a yank

can you please help me to write a small emacs function? This is the first lisp function I am writing and I think I am getting confused with point and mark placement. I want to write a function that ...
3
votes
2answers
474 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
85 views

Trying to copy everything between double quotes, and then make a list of everything that was copied

So I have a defun that I made that is supposed to copy every thing that is between double quotes and then make a list of everything that was copied. I don't know what the problem is, but it doesn't ...
2
votes
3answers
152 views

adhoc emacs Elisp command to send emacs clipboard text to osx clipboard

When you press 'y' (elfeed-search-yank) in an elfeed-search buffer, the selected entry's permalink url is copied to the emacs clipboard. I don't have any automatic clipboard sync packages installed, ...
1
vote
1answer
113 views

How to get mouse copy like done on Lisp Machine Zmacs/ZWEI?

I'd like my emacs v25.3.1 running on Mac OS X to have a mouse middle button functionality that copies what you mouse middle on to the insertion point in your buffer. This is great when writing code ...
1
vote
0answers
64 views

helm-show-kill-ring disregards the selection

When I select entries (with C-<SPACE>) in helm-show-kill-ring and press either Enter or F1, it disregards the selection and yanks the entry currently under cursor. Why would this be the case and ...
2
votes
1answer
171 views

yanking earlier kills not working

I followed the tutorial verbatim and I am unable to yank earlier kills. I have looked online for support, but noone else seems to have this problem. Kill a line, move around, kill another line. ...
2
votes
1answer
235 views

after previous `counsel-yank-pop`, `yank` the last yanked entry

short: after a counsel-yank-pop, yank does not yank the same entry. How can I achieve that behavior? long: Having a kill-ring like: foo bar baz When doing a C-y (yank) and M-y (yank-pop) 'bar' ...
0
votes
1answer
99 views

Can I programmatically get access to the yanked region?

You are likely to want to do things to the text that you just yanks / pasted (wrap it in brackets etc). Is there a way to know what you just yanked? If so I would quite like select it (put the mark ...
1
vote
3answers
77 views

quickly kill and then yank parts of a program

I very often encounter the problem that I have to cut out a part of an expression and need to copy it somerhere else. For example the following python line: courtage_text = data["expose"]["brokerage"]...
2
votes
5answers
116 views

Gathering scattered text to a single location

I am looking for an easy way to gather blocks of text that are scattered throughout an emacs or org-mode document and move (or copy, but move would be preferred) them to a single location. (For ...
1
vote
2answers
435 views

What's the most efficient, idiomatic way to paste-and-replace in Emacs?

I often do something like this: Copy some stuff Go to where I need to paste it Paste it (C-y) Kill the rest of the line (C-k) Select what I just pasted, and copy it again Repeat steps 2-5 The whole "...
3
votes
1answer
216 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
2answers
71 views

Function to duplicate and mark duplicated text

In order to be able to chain the following command, I need the yanked text to be marked. That is because the end goal is to call (pop kill-ring) so that I can still use whatever was at the top of the ...
0
votes
0answers
87 views

dealing with s-expressions in javascript without paredit

I was using paredit for other languages apart from lisp and it was great for being able to delete and yank whole functions etc. but it was also quite buggy with web-mode and js2-mode. Fir example, I ...
0
votes
1answer
138 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 ...
1
vote
2answers
5k views

Paste Windows clipboard with Shift-Insert but not by yanking

I am using Emacs 24.4 on Windows 10. I only ever use it in -nw (no-window) mode. I would like Emacs to paste from the Windows clipboard only on Shift-Insert and not on yank (Ctrl-y). I have tried ...
2
votes
1answer
108 views

What is the problem with this yank function in elisp in emacs?

Idea I will like to construct a simple emacs function that copies the yy functionality in vim. The function should yank a visual-line into kill ring without deleting the line. Function Here is ...
1
vote
1answer
216 views

How can I change yank/delete to show relative line numbers during the yank/delete in evil?

I use evil via spacemacs. When I use yank, it’s mostly whole line numbers – like y20y. To a lesser extent, this is often true of delete – d10d Is there anything I can add to my Spacemacs config to ...
2
votes
1answer
46 views

isearch looses focus when trying to paste into the isearch buffer

strange issue. when i launch isearh and want to paste text into it, after pressing C-s the paste (S-insert) always pastes the text to the current edited buffer and not the isearch window. has anyone ...
0
votes
1answer
744 views

What is the difference between kill-ring-save and copy-region-as-kill?

These two commands seem identical to me. What am I missing?
1
vote
1answer
204 views

I got error when using command yank

When I typed C-y to call yank, I got this. apply: Symbol's value as variable is void: n Debugger entered--Lisp error: (void-variable n) ad-Advice-current-kill( ... [interprogram-paste-function ...
3
votes
1answer
740 views

Copy current URL from web browser from Emacs while editing

When editing code or org-mode, I often need the URL of the page I'm viewing in Google Chrome. Is there a way to do this from Emacs? Or with an external helper script if necessary? An example use ...
10
votes
4answers
2k views

How do I yank and cycle backward through earlier killed text?

Emacs has this very handy kill-ring that can be cycled through after yanking, by pressing M-y repeatedly. Is there a way to switch the cycling direction? So I don not need to cycle through all when I ...
1
vote
2answers
115 views

Kill and yank (append?) text from buffer to bottom of same buffer

I want to be able to kill selected text and yank it to the bottom of the buffer from which it was killed. How do I do this efficiently, meaning not with C-k, moving point to end of buffer, C-y?
6
votes
4answers
2k views

In Evil mode, how can I prevent adding to the kill ring when I yank text, visual mode over other text, then paste over?

If I have text1 text2, I yank text1 with yw then I highlight text2 with vw and paste overwrite that text with p, my kill ring now has text2. I'd prefer if text2 wasn't added to my kill ring because ...
8
votes
3answers
538 views

Use avy to select distant word or line and paste at point

Is there a way to use avy or a similar in-buffer selection tool to quickly select a word or line to paste at the current point? For the following buffer an example workflow for proposed functionality ...
2
votes
0answers
149 views

Prevent emacs to indent when yanking into html buffer

I have disabled electric indent mode, as specified here, but when yanking text, indenting is still performed. I am yanking text into an html buffer, and I do not want any change whatsoever to be ...
2
votes
2answers
156 views

How to avoid double M-y with system clipboard integration in the terminal

I added Mac clipboard integration to my emacs -nw using the following code, adapted from here: (defun copy-from-osx () (shell-command-to-string "pbpaste")) (defun paste-to-osx (text &optional ...
2
votes
1answer
243 views

How to yank text to search command (after “/”) in evil-mode?

Is it there any way to yank in the search command (after press "/") in evil-mode?
2
votes
1answer
68 views

Force append to buffer instead of at point

Is it possible to force an Emacs buffer to place any new text it receives at the end of the buffer, instead of at the mouse point? I mean all of: keystrokes, yanks, mouse paste. I'm thinking in ...
3
votes
1answer
1k 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, ...
0
votes
1answer
185 views

Yank from mouse in helm modes

For many built-in commands that require user input in the minibuffer I can yank from the middle mouse button (mouse-yank-primary with <down-mouse-2>). Some examples where this works are rgrep, ...
3
votes
1answer
181 views

Yank during yas-expand without aborting expansion

When expanding a yasnippet snippet and filling out completion fields yanking/pasting inserts text correctly among fields as expected, but interrupts the snippet expansion behavior (as if pressing C-g /...
5
votes
2answers
280 views

Insert lines when yanking rectangle rather than inserting among following lines?

Having copied the 3x3 rectangular region containing a's, how can I yank/paste that content at the desired point without slicing into the following text? The following is the behavior for: M-w (kill-...