How do I use vim registers?

后端 未结 17 2134
一向
一向 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:21

    My favorite feature is the ability to append into registers by using capital letters. For example, say you want to move a subset of imports from buffer X to buffer Y.

    1. Go to line x1 in buffer X.
    2. Type "ayy to replace register a with the content of line x1.
    3. Go to line x5.
    4. Type "Ayy (capital A) to append line x5 at the end of register a.
    5. Go to buffer Y and type "ap to paste
    
    
    

提交回复
热议问题