Questions tagged [yank]

yanking is the older word for copying a line to a clipboard. Use this tag to ask about how the command is working, or advanced combinations.

yanking is the older word for copying a line to a clipboard. This is favoured in UNIX text editors such as and . Use this tag to ask about how the command is working, or advanced combinations/commands which involve yanking several lines.

68 questions
10
votes
2 answers

"yank" does not paste text when using Emacs over SSH

When I tried to run Emacs on a remote server through ssh, the C-y (even M-x yank) can't work. Every time I press C-y, it says "Mark set", but nothing else happens. I'm working under Linux and the remote server is a Mac pro. Now I can only download…
andy90
  • 525
  • 5
  • 19
9
votes
1 answer

Yank range of lines to clipboard via ':' in vim

I'm yanking range of lines to system clipboard in vim. I can do it with 51gg116"+yy. I'd like to do it via : notation. I can copy to "" register via command :51,116y. However, command 51,116"+y doesn't work. How to fix the last command?
Loom
  • 9,768
  • 22
  • 60
  • 112
8
votes
1 answer

Yank file path with line no from vim to system clipboard

I would like to yank - A full path to the file, e.g. c:\foo\bar\file.txt:94 with its line no I would also like to paste it to my system clipboard so i will use '+' register for this. can you suggest me possible way to do this?
Hardik Juneja
  • 377
  • 1
  • 2
  • 12
7
votes
4 answers

In Vim is there a corresponding change (c) command for paste (p)?

With insertions, it is very easy to both wipe out a word/section and insert over it, like so cw delete until end of word (with space) then go to insert mode ce delete until end of word (without space) then go to insert mode c3w delete until end of…
puk
  • 16,318
  • 29
  • 119
  • 199
7
votes
2 answers

After pasting a yanked line in Vim, why can't I paste it again?

This question was probably answered before, but I tried searching and could not find the answer anywhere. I am somewhat new to Vim and I am having the following issue. Once I yank a line and paste it, i cannot paste it again. For example, say in…
rachkov91
  • 73
  • 1
  • 4
7
votes
3 answers

How to overwrite text by yank in Emacs?

I want to overwrite text by yank as following. Is there any way to do this? kill-ring: text-i-want-to-paste Before: abcdefghijklmnopqrstuvwxyz ^ corsor After: text-i-want-to-pasteuvwxyz
Kei Minagawa
  • 4,395
  • 3
  • 25
  • 43
5
votes
0 answers

ubuntu host docker ubuntu container clipboard share between host and container

I'm using ubuntu 16.04 as docker host and running docker container(also ubuntu 16.04). Also editing codes use neovim via ssh connection to container. But it's really inconvenience to sharing yanked data between host/container. I can sharing yanked…
Archer
  • 189
  • 1
  • 1
  • 6
5
votes
1 answer

How to map yank to OS's clipboard in Vim?

Possible Duplicate: vim: copy selection to OS X clipboard While I succeeded to map paste from clipboard (nmap p "*p), the same for yank (nmap y "*y) doesn't seem working. Actually, it yanks in Vim's clipboard. Any idea how to do…
Adrien
  • 2,088
  • 1
  • 18
  • 35
4
votes
3 answers

Why vim pasting behaves differently depending on yanking method

I see different pasting behaviour depending on how I yanked a line. I would like to know why. If I yank a line starting from normal mode: ^v$y ^ to go to the beginning of the line v to enter visual mode $ to go to the end of the line y to…
Robert
  • 171
  • 9
4
votes
2 answers

yanking by line number in vim

I have a file and I want to do the following. - copy every n lines starting from m (m,m+n,m+2n, ...) - copy line number 2, 5, 27, ... by specifying line numbers. THanks
eli
  • 225
  • 2
  • 9
4
votes
3 answers

how to yank a code block without folded content?

I write a blog that describe the fold of vim. So I need the code like this. +-- 15 lines: set_up_socket_dir () {-------------------------------------------- But when I yank the line, actually yank the folded code. how can i get that line from…
lifeng.luck
  • 601
  • 3
  • 10
4
votes
1 answer

How to copy/paste a region from emacs buffer with line + file reference?

From time to time I see people pasting portions of code with reference to the file name and line number. Something like ;; ----- line:3391 file: simple.el.gz -----;;; (if (eq last-command 'kill-region) (kill-append…
VitoshKa
  • 8,387
  • 3
  • 35
  • 59
3
votes
3 answers

Copy multiple times before pasting all of the contents in vim

In vim, would there be a way to copy multiple times, accumulate each of them into the clipboard, and then later paste all of them at once where each contents are separated by newline?
villybyun
  • 65
  • 8
3
votes
2 answers

How can I get vim yank to clipboard ("*y) working?

According to the vim user manual 04.7 (http://vimdoc.sourceforge.net/htmldoc/usr_04.html#04.7), you can yank from vim to the clipboard with "*y and put into vim from the clipboard with "*p. I can successfully use the "*p command but the "*y command…
achalk
  • 3,229
  • 3
  • 17
  • 37
3
votes
2 answers

Set iskeyword selectively

Often I need to search large xml mode files for the next occurrence of the word under the cursor but preferably not if it's a tag the closing tag In the below example # is where the cursor is. Using * or # with iskeyword not including > or < will…
Steve
  • 388
  • 1
  • 3
  • 14