Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
300 views
in Technique[技术] by (71.8m points)

vim - 如何使用vim寄存器?(How do I use vim registers?)

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

(我只知道一个使用寄存器的实例是通过Ctrl R *的 ,因此我从剪贴板粘贴了文本。)

What are other uses of registers?

(寄存器的其他用途是什么?)

How to use them?

(如何使用它们?)

Everything you know about VI registers (let's focus on vi 7.2) -- share with us.

(您所了解的关于VI寄存器的所有信息(让我们关注vi 7.2)-与我们分享。)

  ask by community wiki translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Registers in Vim let you run actions or commands on text stored within them.

(Vim中的寄存器使您可以对其中存储的文本运行操作或命令。)

To access a register, you type "a before a command, where a is the name of a register. If you want to copy the current line into register k , you can type

(要访问寄存器,请在命令前键入"a ,其中a是寄存器的名称。如果要将当前行复制到寄存器k ,则可以键入)

"kyy

Or you can append to a register by using a capital letter

(或者,您可以使用大写字母追加到注册簿中)

"Kyy

You can then move through the document and paste it elsewhere using

(然后,您可以浏览文档并将其粘贴到其他位置)

"kp

To paste from system clipboard on Linux

(从Linux上的系统剪贴板粘贴)

"+p

To paste from system clipboard on Windows (or from "mouse highlight" clipboard on Linux)

(从Windows上的系统剪贴板(或Linux上的“鼠标突出显示”剪贴板)粘贴)

"*p

To access all currently defined registers type

(要访问所有当前定义的寄存器类型)

:reg

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...