Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vim pastebin workflow

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.

like image 212
Gabriel Solomon Avatar asked Mar 22 '26 08:03

Gabriel Solomon


2 Answers

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
like image 199
Mykola Golubyev Avatar answered Mar 24 '26 01:03

Mykola Golubyev


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.

like image 40
Paul Avatar answered Mar 24 '26 01:03

Paul



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!