LinuxQuestions.org
Visit Jeremy's Blog.
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 09-14-2004, 03:18 AM   #1
blackzone
Member
 
Registered: Jun 2004
Posts: 256

Rep: Reputation: 30
vi question


I know yy for copying line

but how do you copy a string

for example I have "string1 string2"

how do I copy string2 without copying the entire line?
 
Old 09-14-2004, 03:37 AM   #2
ceedeedoos
Member
 
Registered: Aug 2003
Location: Antwerp, Belgium
Distribution: Slackware 10.0, Mandrake 10.1
Posts: 174

Rep: Reputation: 36
go to the s of string2 and press y$
then you have everything from s to the end of the line
or yw to copy the word "string2" also works
 
Old 09-14-2004, 03:37 AM   #3
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
yw will 'yank' (y) one word (w)

You can also yank multiple words/lines:

4yy => yank 4 lines, from cursor position downwards.
3 yw => yank next 3 words, from cursor position.

btw: yy is not copying, it stores the yanked line into a buffer. The p command puts the line from buffer into your text.
 
Old 09-14-2004, 03:37 AM   #4
schandak
LQ Newbie
 
Registered: Sep 2004
Posts: 10

Rep: Reputation: 0
go below string2 and in escape and do "dw" and
do "p" ,whever who want to paste the string2

u can search googl e for "vi quick refence" ,which will answer all ur queries.
this is a one-page document !!!!!

Suresh
 
  


Reply



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
Question, Apples Contribution to Open Source + MacOs file structure question Higgy3k Other *NIX 5 07-25-2005 04:23 AM
Not your regular GRUB question - just a short question for a fried MBR!! ziphem Linux - General 3 01-31-2005 01:51 PM
2 part question: Speeding up MDK9.1/GNOME question wardialer Linux - Newbie 6 10-14-2004 03:16 PM
login prompt question & kde scheme question JustinCoyan Slackware 2 06-09-2004 02:02 PM
RE: Suse 8.0 hardware question {newbie question, pls help} Radiouk Linux - Distributions 2 06-04-2002 12:53 PM

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

All times are GMT -5. The time now is 12:14 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