-   Linux - Newbie (
-   -   copy-paste in vim (

proNick 02-17-2008 06:08 PM

copy-paste in vim
hi all!

can i somehow copy and then paste text in vim?

tnx in adv!

Lepakko 02-17-2008 06:13 PM

You indeed can. Check out , you have the whole operation explained there.

jschiwal 02-17-2008 06:13 PM

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.

gilead 02-17-2008 07:31 PM

You can also use the mouse in vim/gvim - there's some info here

dive 02-17-2008 07:36 PM

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

chrism01 02-17-2008 08:29 PM

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.

All times are GMT -5. The time now is 03:29 AM.