LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux > Linux - Newbie
User Name
Password
Linux - Newbie This 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

Tags used in this thread
Popular LQ Tags , ,

Reply
 
Thread Tools
Old 02-21-2006, 04:11 AM   #1
geokker
Member
 
Registered: Jun 2004
Distribution: Ubuntu 6.10 Edgy Eft
Posts: 45
Thanked: 0
Copy an entire document in Vi to clipboard


[Log in to get rid of this advertisement]
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?
geokker is offline     Reply With Quote
Old 02-21-2006, 05:18 AM   #2
jschiwal
Moderator
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 12,877
Thanked: 232
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.
jschiwal is offline     Reply With Quote
Old 08-06-2009, 04:14 PM   #3
gansvv
LQ Newbie
 
Registered: Jun 2009
Location: Gainesville, Fl
Distribution: Ubuntu Hardy Heron
Posts: 2
Thanked: 0
Thumbs up Re: Copy an entire document in Vi to clipboard

Use

:%y+

to yank all lines.

G/
gansvv is offline  
Tag This Post , ,
Reply With Quote

Reply

Bookmarks


Thread Tools

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 10:39 AM
Clipboard Manager for quickly copy paste saurya_s Linux - Software 1 09-22-2005 10:33 AM
copy and paste not working (requested clipboard format not available) marie-p Linux - Software 1 01-23-2005 12:44 PM
how do I copy a selection from xterm to clipboard? hollywoodb Linux - Newbie 1 10-06-2003 01:43 AM
Perl script: how to substitute through entire document? mister_math Programming 2 03-08-2003 12:38 AM


All times are GMT -5. The time now is 12:04 AM.

Main Menu
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
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration