LinuxQuestions.org
Help answer threads with 0 replies.
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, 04:18 AM   #1
blackzone
Member
 
Registered: Jul 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, 04:37 AM   #2
ceedeedoos
Member
 
Registered: Aug 2003
Location: Antwerp, Belgium
Distribution: Slackware 10.0, Mandrake 10.1
Posts: 174

Rep: Reputation: 35
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, 04:37 AM   #3
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390
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, 04: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


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

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

All times are GMT -5. The time now is 11:22 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration