In vim is there a way to delete without putting text in the register?

Posted by Edward Tanguay on Stack Overflow See other posts from Stack Overflow or by Edward Tanguay
Published on 2008-09-10T14:46:35Z Indexed on 2010/04/01 1:53 UTC
Read the original article Hit count: 344

Filed under:
|

Using vim I often want to replace a block of code with a block that I just yanked. But when I delete the block of code that is to be replaced, that block itself goes into the register which erases the block I just yanked. So I've got in the habit of yanking, then inserting, then deleting what I didn't want, but with large blocks of code this gets messy trying to keep the inserted block and the block to delete separate.

So what is the slickest and quickest way to replace text in vim?

  • is there a way to delete text without putting it into the register?
  • is there a way to say e.g. "replace next word" or "replace up to next paragraph"
  • or is the best way to somehow use the multi-register feature?

© Stack Overflow or respective owner

Related posts about vim

Related posts about vi