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

3477 questions
12
votes
5 answers

Copy NSAttributedString in UIPasteBoard

How do you copy an NSAttributedString in the pasteboard, to allow the user to paste, or to paste programmatically (with - (void)paste:(id)sender, from UIResponderStandardEditActions protocol). I tried: UIPasteboard *pasteBoard = [UIPasteboard…
Guillaume
  • 21,685
  • 6
  • 63
  • 95
12
votes
4 answers

How to maintain tabs when pasting in Vim

I use the tab key to indent my python code in Vim, but whenever I copy and paste a block Vim replaces every tab with 4 spaces, which raises an IndentationError I tried setting :set paste as suggested in related questions but it makes no…
Awalias
  • 2,027
  • 6
  • 31
  • 51
11
votes
6 answers

Java tool to find - copy/ paste code across projects

We inherited some leagcy code that has a whole lot of code copy/pasted across projects. Is there a way to find these? PMD can do a single project
shikarishambu
  • 2,219
  • 6
  • 35
  • 57
11
votes
10 answers

vim copy and replace text

Lets say that i have this text: $test = 'lorem'; $test2= 'ipsum'; and I want to copy lorem and paste into ipsum. I tried to do yi' on lorem and then went on ipsum and did ci' but that replaced my pastebin with ipsum. and my previous copy was lost.
Gabriel Solomon
  • 29,065
  • 15
  • 57
  • 79
11
votes
2 answers

How to change the default shortcuts for copy/paste in urxvt?

I'm trying to set up copy/paste actions using ctrl+shift+c/p like it is done in GNOME terminal but for urxvt. I didn't find any simple solution - it seems like it always requires scripts, hacks etc which gets me annoyed when it comes to such a basic…
Timur Fayzrakhmanov
  • 17,967
  • 20
  • 64
  • 95
11
votes
2 answers

Android Copy & Paste to any text field in any application

I am developing an app for commercial use with a background service that is getting transponder numbers (of animals) from an RFID reader via bluetooth. After processing the received number I would like to send it to the clipboard and paste it in the…
markus s
  • 1,024
  • 1
  • 11
  • 20
11
votes
1 answer

How to detect copy to clipboard functionality before using it

I'm trying to create a copy function in pure JS, so no flash. The problem I've got is that I don't want to show the copy button when the browser doesn't support copying to clipboard. I'm using the document.execCommand('copy') method to do the…
silverlight513
  • 5,268
  • 4
  • 26
  • 38
11
votes
2 answers

How to add item into popup copy/paste menu on a android selected textview?

please look this screenshot. In normal case, when text be selected, a popup menu opened, but only have cut/paste item. I want to know, how to add item just like this "web search / share" into this popup menu? What's this popup menu? I had tried to…
hyyou2010
  • 791
  • 11
  • 22
11
votes
13 answers

Shortcut for copying Ctrl-C not working in Android Studio

I am able to copy text from other programs and paste it to Android Studio. I am able to right click and copy selected text. I am able to cut text and paste it using shortcut. But while using shortcut Ctrl + C to copy text I am often unable to copy.…
Suresh Subedi
  • 660
  • 2
  • 10
  • 25
11
votes
5 answers

limit how many characters can be pasted in textarea

Is it possible to detect how many characters are being pasted into a HTML textarea, and cancel the paste if beyond a limit? Edit: what I am trying to do is prevent the user pasting a massive amount of characters (~3 million) because it crashes some…
hoju
  • 28,392
  • 37
  • 134
  • 178
11
votes
2 answers

How to copy to clipboard with X11?

Using the frameworks on OS X, I can use the following to copy a PNG to the pasteboard (in C — obviously I could use NSPasteboard with Cocoa): #include int copyThatThing(void) { PasteboardRef…
Michael
  • 11,612
  • 10
  • 41
  • 43
11
votes
4 answers

Copy/Paste/Calculate Visible Cells from One Column of a Filtered Table

I am using AutoFilter to sort through a table in VBA, which results in a smaller table of data. I only want to copy/paste the visible cells of one column after the filter is applied. Also, I would like to average the filtered values of one column…
ruya
  • 391
  • 3
  • 5
  • 12
11
votes
4 answers

How to copy the contents of a Multiline textbox to the clipboard in C#?

I have some text coming from database in a Multiline textbox, how can I copy that to the clipboard so that the user can paste it into another window or file (e.g. from my application to another textbox)? OR to notepad/word file if possible.
Paz
  • 694
  • 1
  • 5
  • 14
10
votes
6 answers

Java: how to handle retries without copy-paste code?

I have multiple cases when I have to deal retrial for DB and networking operations. Everywhere I do it I have the following type of code: for (int iteration = 1; ; iteration++) { try { data = doSomethingUseful(data); …
Artem
  • 7,275
  • 15
  • 57
  • 97
10
votes
4 answers

Copy one column from one database to another

I need to copy the content from a column in one database into the matching column in another, so that the same content goes in the record with the same ID. Something like the following pseudo stuff: SET database2.table1.columnA TO…
Mild Fuzz
  • 29,463
  • 31
  • 100
  • 148