VIM Replace word with contents of paste buffer?

后端 未结 9 1460
灰色年华
灰色年华 2020-12-22 15:41

I need to do a bunch of word replacements in a file and want to do it with a vi command, not an EX command such as :%s///g. I know that this is the typical way

9条回答
  •  春和景丽
    2020-12-22 15:57

    Do you mean the system paste buffer or the vi register?

    If you want to use the system paste buffer then you are fine and could do dw"+P - " chooses a register, and "+ is the system paste buffer.

    Otherwise copy into the non-default register with say "ay to copy into register a and then to replace something do dw"aP

提交回复
热议问题