Select ALL in VI Editor | Unix Linux Forums | UNIX for Dummies Questions & Answers

  Go Back    


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 !!

Select ALL in VI Editor

UNIX for Dummies Questions & Answers


Tags
select all text vi, vi select all

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 08-10-2006
rakish rakish is offline
Registered User
 
Join Date: Aug 2006
Last Activity: 11 August 2006, 12:37 PM EDT
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Question Select ALL in VI Editor

Hi all,

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

Rakesh Gupta
Sponsored Links
    #2  
Old 08-10-2006
rhfrommn rhfrommn is offline Forum Advisor  
Registered User
 
Join Date: Nov 2003
Last Activity: 25 January 2012, 5:08 PM EST
Location: Minnesota
Posts: 447
Thanks: 0
Thanked 2 Times in 2 Posts
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"
Sponsored Links
    #3  
Old 08-10-2006
rakish rakish is offline
Registered User
 
Join Date: Aug 2006
Last Activity: 11 August 2006, 12:37 PM EDT
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
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
    #4  
Old 08-10-2006
tmarikle tmarikle is offline Forum Advisor  
Registered User
 
Join Date: Jan 2005
Last Activity: 27 September 2011, 12:36 PM EDT
Posts: 683
Thanks: 0
Thanked 4 Times in 4 Posts
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

Sponsored Links
    #5  
Old 08-10-2006
rakish rakish is offline
Registered User
 
Join Date: Aug 2006
Last Activity: 11 August 2006, 12:37 PM EDT
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Hammer & Screwdriver 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
Sponsored Links
    #6  
Old 08-10-2006
tmarikle tmarikle is offline Forum Advisor  
Registered User
 
Join Date: Jan 2005
Last Activity: 27 September 2011, 12:36 PM EDT
Posts: 683
Thanks: 0
Thanked 4 Times in 4 Posts
My bad, it was a typo.
Sponsored Links
    #7  
Old 08-10-2006
tansha tansha is offline
Registered User
 
Join Date: May 2006
Last Activity: 13 February 2009, 1:52 PM EST
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
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
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Reboot and Select Proper Boot device or insert Boot media in select Boot device and press a key rpf Boot Loaders 0 03-22-2011 03:20 PM
Epic Editor was not able to obtain a license for your use. Feature Epic Editor :Licen durgaprasadr13 Solaris 1 10-13-2008 07:39 AM
set EDITOR=vi -> default editor not setting for cron tab aarora_98 Shell Programming and Scripting 6 09-13-2008 02:01 AM
Pasting text in VI editor from a different editor harishmitty UNIX for Dummies Questions & Answers 10 09-10-2008 06:22 PM
How to select Test in Vi Editor Aejaz UNIX for Advanced & Expert Users 2 04-30-2008 11:55 AM



All times are GMT -4. The time now is 02:43 AM.