Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 02-21-2006, 04:11 AM   #1
Registered: Jun 2004
Distribution: Ubuntu 6.10 Edgy Eft
Posts: 61

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, 05:18 AM   #2
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
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, 04:14 PM   #3
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



to yank all lines.



full, vim

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:03 PM.

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