Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 06-25-2002, 08:16 PM   #1
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
Registered: Mar 2002
Distribution: Ubuntu 6.10
Posts: 165

Rep: Reputation: 30
Here are some common vi commands, hope this helps you out.
Old 06-26-2002, 03:28 AM   #3
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:
That will copy the line to the buffer.

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:
and the line will be pasted below the current position of the cursor.
Old 06-26-2002, 06:29 AM   #4
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
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,
2 words
so on.


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
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 > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:00 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration