LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-21-2006, 03:11 AM   #1
geokker
Member
 
Registered: Jun 2004
Distribution: Ubuntu 6.10 Edgy Eft
Posts: 64

Rep: Reputation: 15
Copy an entire document in Vi to clipboard


When reading a document with vi on a remote machine over ssh, how can I 'select all' and copy to my local clipboard? I imagine selecting two points in the document and 'yanking' the text - how do I do it?
 
Old 02-21-2006, 04:18 AM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
It would probably work better if you would use scp to copy the file. If you just want a part of the file, you can write out a range of lines or a block.
For example, in vim
:200,400w fragment
will write the lines from 200-400 to a file called fragment. Vim has a shell escape, ":!", so after that you could copy the file "fragment" to your local machine using the scp command.
 
Old 08-06-2009, 03:14 PM   #3
gansvv
LQ Newbie
 
Registered: Jun 2009
Location: Gainesville, Fl
Distribution: Ubuntu Hardy Heron
Posts: 2

Rep: Reputation: 0
Thumbs up Re: Copy an entire document in Vi to clipboard

Use

:%y+

to yank all lines.

G/
 
  


Reply

Tags
full, vim



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
copy from terminal to clipboard curos Linux - Newbie 2 02-04-2006 09:39 AM
Clipboard Manager for quickly copy paste saurya_s Linux - Software 1 09-22-2005 09:33 AM
copy and paste not working (requested clipboard format not available) marie-p Linux - Software 1 01-23-2005 11:44 AM
how do I copy a selection from xterm to clipboard? hollywoodb Linux - Newbie 1 10-06-2003 12:43 AM
Perl script: how to substitute through entire document? mister_math Programming 2 03-07-2003 11:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration