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
13
votes
2 answers

Copy/Paste part of a file into another file using Terminal (or Shell)

I am trying to copy part of a .txt file from the line number n to the line number n+y (let's say 1000 to 1000000). I tried with operators and sed, and it failed. Here's the command I tried: sed -n "1000, 1000000p" path/first/file >…
WarioBrega
  • 195
  • 1
  • 3
  • 10
13
votes
3 answers

How to save off the pasteboard contents first and restore them afterward?

I have a faceless Mac OS X app which needs to copy selection from other apps. I achieve this by simulating CMD+C keystrokes. It works perfectly. But there is a, I think it's critical, side effect. It'll override users' pasteboard without their…
Lucidus
  • 161
  • 1
  • 5
13
votes
2 answers

Jekyll Code snippet copy-to-clipboard button

The Problem I am building a Jekyll site with the minima theme to publish some tutorial online. The tutorial pages contain many code snippets, for example: ```javascript /* Global scope: this code is executed once */ const redis =…
Adam Matan
  • 128,757
  • 147
  • 397
  • 562
13
votes
4 answers

Smart indenting in vim (normally great) is a disaster when pasting in a chunk of code

I guess other editors are smart enough to turn that stuff off for pasting but when using vim in a terminal it can't distinguish between pasting and actual typing. What kinds of solutions or workarounds do you have for this? Added: there's also a…
dreeves
  • 26,430
  • 45
  • 154
  • 229
13
votes
3 answers

Copying and merging directories excluding certain extensions

I want to copy multiple directories with identical structure (subdirectories have the same names) but different contents into a third location and merge them. At the same time, i want to ignore certain file extensions and not copy them. I found…
Ma0
  • 15,057
  • 4
  • 35
  • 65
13
votes
2 answers

How to stop Chrome from turning relative links to absolute links on copy/paste?

I'm copying rich text from a div with contenteditable="true" and pasting it to a Medium draft. Most of the formatting is preserved fine, but for some reason I don't understand all relative links are converted to absolute ones. I don't know on what…
Ariel
  • 3,383
  • 4
  • 43
  • 58
13
votes
5 answers

Listview with copy-paste

Is there an easy way of adding copy-paste for a listview, or should I just switch to DataGridView instead? My application is kinda like an address book, it contains emails, numbers etc where copy paste would be useful.
Zubirg
  • 187
  • 1
  • 2
  • 9
13
votes
2 answers

Text copied from vim inside a tmux session is padded with spaces to the right

When I run Vim from inside a tmux session and copy some text to the clipboard, each line gets padded with spaces to the right. For example, say I have a text file like this: ^some$ ^text$ Note: I've used ^ and $ to mark the beginning and end of a…
Michael Härtl
  • 8,428
  • 5
  • 35
  • 62
13
votes
5 answers

Tmux copy buffer limit

Whenever I copy something (usually with a mouse) from a tmux buffer, and paste it later in ViM, the contents are truncated. Last attempt gave me only about 750bytes of the full block I copied. This is in iTerm on a Mac.
Evert
  • 93,428
  • 18
  • 118
  • 189
12
votes
1 answer

How to send interrupt key sequence to a Java Process?

I've got a handle to a Java Process instance and its associated streams. It's a console program. I'd like to simulate a break sequence. On Windows this is Ctrl-C. Is this possible without natives? The reason for doing this: the console program is a…
Ben Vitale
  • 1,754
  • 3
  • 17
  • 27
12
votes
1 answer

How to view clipboard on mac with all formatting

How can I view the clipboard on a mac with all formatting applied? For example, if I copy-paste a table in Excel, not only does it copy the text, but it also copies formatting (I believe it copies it as an html object to the clipboard). How would I…
samuelbrody1249
  • 4,379
  • 1
  • 15
  • 58
12
votes
1 answer

How to programmatically copy/paste in windows phone?

Possible Duplicate: Can the new WP7 cut and paste functionality be used programatically? Is there a way to programmatically copy/paste text in windows phone. I want the user to click on a button that should automatically copy some text to the…
hlgphone
  • 121
  • 1
  • 3
12
votes
3 answers

emacs terminal mode: how to copy and paste efficiently

I'm having a hard time making this emacs -nw work effectively under the terminal mode (emacs -nw). Some setup information: The working server is connected via SSH, and emacs is running on the server. Usually I'm connecting using SSH and "emacs -nw"…
galactica
  • 1,753
  • 2
  • 26
  • 36
12
votes
2 answers

External Clipboard Manager breaking in JIdea

I use an external clipboard (ClipMenu) on Mac OS X 10.8.5 with IntelliJ Idea 13.0.3. It works everywhere else, but breaks consistently in JIdea.
shiri
  • 745
  • 6
  • 24
12
votes
2 answers

Copy-Paste image in Android using Clipboard Manager

I would like to copy image from my android application to the other android application using clipboard manager. I have researched a lot and read this tutorial but it doesn't cover the image copying part. The below code which copies image but when I…
user2215256
  • 123
  • 1
  • 1
  • 4