views:

244

answers:

3

Hello i have recently started using vim editor ( actually the plugin for netbeans ) and i am having trouble with the pastebin.

What would happen is i would yunk something in, and then do some deletes with dd and so i lose my initial yunk content. So for me as a beginner with vim its very confusing that delete actually does cut.

How do you guys usually go about this. I guess you have to paste it immediately after you yunk it, but wanted to know if you have other tricks about this.

thanks

+7  A: 

You can use named registers to yunk

"ayw
"byy
"cy$
etc.

Where 'a', 'b', 'c' are names of registers.
to paste use

"ap 
"bP
"cp

Default register is '"' and the system register is '+' and '*'

You can use unnamed register (black hole) to delete - in this way you won't overwrite information in the default register ('"').

"_dd
"_dw
"_D
Mykola Golubyev
+3  A: 

What would happen is i would yunk something in, and then do some deletes with dd and so i lose my initial yunk content.

No, you don't. Your yunked text is in register "0.

:help "0 for more info.

Paul
A: 

Since jumping around in the file is quite easy and fast, I tend to just cat and then paste directly. (Sorry for the boring answer)

/Johan

Johan