LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 06-25-2002, 08:16 PM   #1
cli_man
Member
 
Registered: Apr 2002
Location: New York, USA
Distribution: Redhat 7.2, 9.0 Slackware 9.1
Posts: 428

Rep: Reputation: 30
Arrow Simple vi question


How do you highlight a line or just a word or two and then cut and paste it into a different part of the document? This shouldn't be a prob for you guys. Thanks
 
Old 06-25-2002, 08:36 PM   #2
MikeeX
Member
 
Registered: Mar 2002
Distribution: Ubuntu 6.10
Posts: 165

Rep: Reputation: 30
Here are some common vi commands, hope this helps you out.

http://www.ctssn.com/linux/lesson4.html
 
Old 06-26-2002, 03:28 AM   #3
riscrocket
LQ Newbie
 
Registered: Jun 2002
Location: Huntington Beach, CA USA
Distribution: Red Hat x86 / YDL PPC
Posts: 14

Rep: Reputation: 0
with the cursor anywhere in a line, in command mode type:
yy
That will copy the line to the buffer.

type:
P
and the line will be pasted above the line of the current position of the cursor. (You can move the cursor up or down, and then type 'P')

or type:
p
and the line will be pasted below the current position of the cursor.
 
Old 06-26-2002, 06:29 AM   #4
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 47
Just to add something on to the previous reply. The yy command yanks the current line. Like lots of other vi commands you can add a number in front of that to yank multiple lines.

Ex: 5yy (Will yank 5 lines)

And as a shortcut 5Y is equivalent to 5yy.
 
Old 06-26-2002, 09:25 AM   #5
neo77777
LQ Addict
 
Registered: Dec 2001
Location: Brooklyn, NY
Distribution: *NIX
Posts: 3,704

Rep: Reputation: 56
and if you want to yank a word at cursor position,
wy
2 words
2wy
so on.
 
  


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
Ubuntu Fluxbox simple question, simple answer? generallimptoes Linux - Software 3 09-26-2005 02:03 PM
Installing Programs - A simple question from my simple mind jmp875 Linux - Newbie 6 02-18-2004 09:03 PM
Hopefully a Simple Question Arcane Kidd Linux - Newbie 5 01-17-2003 04:27 PM
Really Simple Question -- Please help! Cia420 Linux - General 3 05-07-2002 06:42 AM
simple question seeking simple answer enzo250gto Linux - Newbie 1 10-27-2001 04:08 AM

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

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