4 ms·
If usually delete to another register to avoid that, "dd for example :)
by jarenmf 5y ago
If usually delete to another register to avoid that, "dd for example :)
- normie3000 5y agoDoesn’t dd delete the line under the cursor?
- Veen 5y agodd deletes the line under the cursor. "dd deletes something into the d register (the " is part of the command that selects the register). "d selects the register. The second d is the delete command. So you could do something like "dd2w to delete the next two words and save them into the d register. The same thing works with any named register, so a less confusing example might have been "cd2w to delete into the c register.
- Tyr42 5y agoThere's also a dedicated null register "_, so "_d really just deletes it without storing it anywhere. But I agree _ is harder to reach than d. I also really like junegunn/vim-peekaboo, which really helps if I know I copied something, but I'm not sure how far down the stack it is.
- boondaburrah 5y agoAs a VIM noob for the past 7 years, I've learned many times over that dd is cut (like yy is copy), not delete, despite what people say.