How do I use vim registers?

后端 未结 17 2141
一向
一向 2020-11-27 08:58

I only know of one instance using registers is via CtrlR* whereby I paste text from a clipboard.

What are other uses of registers?

17条回答
  •  天命终不由人
    2020-11-27 09:27

    If you ever want to paste the contents of the register in an ex-mode command, hit .

    Why would you use this? I wanted to do a search and replace for a longish string, so I selected it in visual mode, started typing out the search/replace expression :%s/[PASTE YANKED PHRASE]//g and went on my day.

    If you only want to paste a single word in ex mode, can make sure the cursor is on it before entering ex mode, and then hit when in ex mode to paste the word.

提交回复
热议问题