Review your favorite Linux distribution.
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 02-17-2008, 06:08 PM   #1
Registered: Apr 2005
Posts: 104

Rep: Reputation: 15
copy-paste in vim

hi all!

can i somehow copy and then paste text in vim?

tnx in adv!
Old 02-17-2008, 06:13 PM   #2
Registered: Feb 2008
Location: Mannheim, Germany
Distribution: Debian Etch
Posts: 44

Rep: Reputation: 16
You indeed can. Check out , you have the whole operation explained there.
Old 02-17-2008, 06:13 PM   #3
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 658Reputation: 658Reputation: 658Reputation: 658Reputation: 658Reputation: 658
Use the "y" key. It means "Yank". Follow the command with a movement. For example, "y3j" will copy 4 lines. The current line and the three below it. You can also use something like, "y4w" to yank 4 words to the right, or ":.,/^$/y" to yank the rest of the paragraph. To paste use the "p" key.
Old 02-17-2008, 07:31 PM   #4
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,124

Rep: Reputation: 164Reputation: 164
You can also use the mouse in vim/gvim - there's some info here
Old 02-17-2008, 07:36 PM   #5
Senior Member
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,217

Rep: Reputation: 295Reputation: 295Reputation: 295
You can also use v (visual mode) to hilight text, then use y or d (cut) and p.

Last edited by dive; 02-17-2008 at 07:38 PM.
Old 02-17-2008, 08:29 PM   #6
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.7, Centos 5.10
Posts: 16,916

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
Yeah (after gilead) mouse is way easier..., but worth knowing the other y/p options exist just in case you have to work on a real console.


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
can't paste into vim JosephS Linux - Software 7 01-03-2010 05:26 AM
How to copy paste into VIM ? EAD Linux - Software 15 12-12-2006 07:38 PM
Buggy copy n paste with vim in terminal Kovacs Slackware 1 09-05-2006 01:13 AM
cygwin vim copy/paste problem takahaya Linux - Software 2 03-31-2006 02:16 AM
how to copy and paste acd copy cd paschim Linux - General 2 04-05-2004 10:25 AM

All times are GMT -5. The time now is 07:19 PM.

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