LinuxQuestions.org
Register a domain and help support LQ
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 02-17-2008, 05:08 PM   #1
proNick
Member
 
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, 05:13 PM   #2
Lepakko
Member
 
Registered: Feb 2008
Location: Mannheim, Germany
Distribution: Debian Etch
Posts: 44

Rep: Reputation: 16
You indeed can. Check out http://www.tech-recipes.com/unix_tips219.html , you have the whole operation explained there.
 
Old 02-17-2008, 05:13 PM   #3
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
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, 06:31 PM   #4
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,123

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

Rep: Reputation: 292Reputation: 292Reputation: 292
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 06:38 PM.
 
Old 02-17-2008, 07:29 PM   #6
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,261

Rep: Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028
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.
 
  


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


All times are GMT -5. The time now is 03:13 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration