Questions tagged [copy-paste]

For issues relating to cut, copy, and paste operations.

The term "copy-and-paste" refers to the popular, simple method of reproducing text or other data from a source to a destination. It differs from cut and paste in that the original source text or data does not get deleted or removed. The popularity of this method stems from its simplicity and the ease with which users can move data between various applications visually – without resorting to permanent storage.

Source: Wikipedia

3029 questions
3730
votes
62 answers

How do I copy to the clipboard in JavaScript?

What is the best way to copy text to the clipboard (multi-browser)? I have tried: function copyToClipboard(text) { if (window.clipboardData) { // Internet Explorer window.clipboardData.setData("Text", text); } else { …
Santiago Corredoira
  • 40,844
  • 8
  • 48
  • 56
699
votes
31 answers

How do you copy and paste into Git Bash

I'm using msysgit running on Windows XP. Tried Ctrl+V, Right click, Middle click, google... no luck.
Trav L
  • 13,104
  • 5
  • 28
  • 37
631
votes
11 answers

How to paste yanked text into the Vim command line

I'd like to paste yanked text into Vim's command line. Is it possible?
dan
  • 39,098
  • 40
  • 137
  • 234
380
votes
23 answers

How to Copy Text to Clip Board in Android?

Can anybody please tell me how to copy the text present in a particular textview to clipboard when a button is pressed? @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); …
362
votes
21 answers

Paste text on Android Emulator

Is there an easy way to copy/paste (desktop's) clipboard content to EditView on Android Emulator? (just for the sake to ease development/test)
ankitjaininfo
  • 10,748
  • 7
  • 47
  • 74
289
votes
18 answers

Copy and paste content from one file to another file in vi

I am working with two files, and I need to copy a few lines from one file and paste into another file. I know how to copy (yy) and paste (p) in the same file. But that doesn't work for different files. How is this done? Also, is there a way to…
macha
  • 6,657
  • 17
  • 56
  • 82
251
votes
15 answers

Copying text outside of Vim with set mouse=a enabled

After enabling set mouse=a, text copied inside of Vim will not paste outside of Vim. Does anybody know of a way to fix this? Here, selecting text with the mouse turns on visual mode and disables the Copy option in the popup menu:
lyuba
  • 5,700
  • 7
  • 25
  • 37
190
votes
1 answer

How to copy text to the client's clipboard using jQuery?

The workflow is simple: You click inside a textarea. The text is copied to the client's clipboard. Display notice to the user. How do you do it?
mager
  • 4,553
  • 6
  • 26
  • 30
187
votes
7 answers

How to delete (not cut) in Vim?

How can I delete a line without putting it into my default buffer? Example: line that will be copied. line that I want to be substitued with the previous one. What I'm trying to do: yy dd p But Vim replaces the recent copied string with the…
MaikoID
  • 3,260
  • 4
  • 21
  • 26
161
votes
6 answers

How to paste text to end of every line? Sublime 2

I'm curious if there is a way to paste text to the end of every line in Sublime 2? And conversely, to the beginning of every line. test line one test line two test line three test line four ... Say you have 100 lines of text in the editor, and you…
Tony H.
  • 1,915
  • 4
  • 14
  • 20
132
votes
18 answers

Why is "copy and paste" of code dangerous?

Sometimes, my boss will complain to us: Why do we need such a long time to implement a feature? Actually, the feature has been implemented in another application before, you just need to copy and paste codes from there. The cost should be…
Yigang Wu
  • 3,486
  • 5
  • 34
  • 54
129
votes
9 answers

How do I enable standard copy paste for a TextView in Android?

I want to enable standard copy paste for a TextView (the same as for EditText). How can I do it? I tried using a non-editable EditText but it didn't work well (sometimes it became editable or the copy paste overlay was not shown). And it's probably…
Ixx
  • 29,955
  • 39
  • 123
  • 217
120
votes
13 answers

How to copy text from Emacs to another application on Linux

When I cut (kill) text in Emacs 22.1.1 (in its own window on X, in KDE, on Kubuntu), I can't paste (yank) it in any other application.
memius
  • 3,835
  • 4
  • 24
  • 25
109
votes
5 answers

Capturing Ctrl-c in ruby

I was passed a long running legacy ruby program, which has numerous occurrences of begin #dosomething rescue Exception => e #halt the exception's progress end throughout it. Without tracking down every single possible exception these each…
Tim Snowhite
  • 3,608
  • 2
  • 21
  • 27
107
votes
3 answers

How can I copy & paste, or duplicate, an existing project?

I've got an existing Hudson project that is configured and working. I need to duplicate the project so that I can have the original and then change the new one so that it points to a different source control. I don't want to manually recreate the…
Derick Bailey
  • 69,055
  • 21
  • 193
  • 207
1
2 3
99 100