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
278 views
in Technique[技术] by (71.8m points)

vim - 在Vim中复制整行(Duplicate a whole line in Vim)

如何以类似于IntelliJ IDEA / Resharper中的Ctrl + D或Eclipse中的Ctrl + Alt + / ↓的方式在Vim中复制整行?

  ask by sumek translate from so

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

1 Answer

0 votes
by (71.8m points)

y y or Y to copy the line (mnemonic: y ank )

(y yY复制行(助记符: y ank ))
or

(要么)
d d to d elete the line (Vim copies what you deleted into a clipboard-like "register", like a cut operation)

(d dd elete行(VIM拷贝你删除到剪贴板中,如“注册”,如剪切操作))

then

(然后)

p to p aste the copied or deleted text after the current line

(pp ASTE复制或在当前行之后删除的文本)
or

(要么)
P to p aste the copied or deleted text before the current line

(PP ASTE复制或当前行之前删除的文字)


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

...