The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
set EDITOR=vi -> default editor not setting for cron tab aarora_98 Shell Programming and Scripting 6 09-12-2008 11:01 PM
How to select Test in Vi Editor Aejaz UNIX for Advanced & Expert Users 2 04-30-2008 08:55 AM
Awk - select from a list simha77777 UNIX for Dummies Questions & Answers 14 02-07-2008 09:42 AM
Out put with select date. Help !!! sabercats Shell Programming and Scripting 4 02-27-2006 02:52 PM
select() and read() jnuno High Level Programming 2 11-19-2002 11:03 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 08-10-2006
Registered User
 

Join Date: Aug 2006
Posts: 4
Question Select ALL in VI Editor

Hi all,

How can i select all and copy text in VI Editor.

Rakesh Gupta
Reply With Quote
Forum Sponsor
  #2  
Old 08-10-2006
Registered User
 

Join Date: Nov 2003
Location: Minnesota
Posts: 388
The only thought I have is to go to the top line of your document and do "yyX", where X is the number of lines in your doc. That will yank all the lines into the buffer. Then put your cursor where you want the copy to go and do a "p"
Reply With Quote
  #3  
Old 08-10-2006
Registered User
 

Join Date: Aug 2006
Posts: 4
Question Any shorter way???

Is there no other way as with yyX i would have to know the number of lines in advance (though its not a problem) but still if there is shorter way please point it out.

Thanks for the reply,

Rakesh
Reply With Quote
  #4  
Old 08-10-2006
Registered User
 

Join Date: Jan 2005
Posts: 682
You can do it this way also, which doesn't require you to know the number of lines:

Code:
:%Y a
which yanks all lines into buffer a.

Then, when you want to paste, position your cursor where you want it and type this in (without being in command mode):

Paste below the cursor position:
Code:
"ap
or

Paste above the cursor position:
Code:
"aP
Reply With Quote
  #5  
Old 08-10-2006
Registered User
 

Join Date: Aug 2006
Posts: 4
Wink type :%y a instead of :%Y a

I tried

Quote:
:%Y a
in my VI editor for GNOME Terminal 2.6.0

Quote:
E492: Not an editor command: %Y a
but

Quote:
:%y a
works fine.

I think we sould type :

Quote:
%y a instead of :%Y a
thanks for the reply
Reply With Quote
  #6  
Old 08-10-2006
Registered User
 

Join Date: Jan 2005
Posts: 682
My bad, it was a typo.
Reply With Quote
  #7  
Old 08-10-2006
Registered User
 

Join Date: May 2006
Posts: 23
Hi,
Can you elaborate pls. Does the command allow you to paste it another file?

I tried but it would not work. Any clue?
Thanks
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 11:47 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0