多次粘贴 [英] Paste multiple times

查看:25
本文介绍了多次粘贴的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

用剪贴板内容替换多行的最佳方法是什么?

What is the best way replace multiple lines with the contents of the clipboard?

我遇到的问题是,当我拉出一行并将其粘贴到另一行上时,拉出"被我刚刚替换的行所替换.现在,如果我想用同一行替换另一行,我必须返回并再次拉动它.

The problem I'm having is when I yank a line and paste it over another line the "yank" is replaced with the line I just replace. Now, if I want to replace another line with the same line I have to go back up and yank it again.

必须有更好的方法来做到这一点.

There's got to be a better way to do this.

推荐答案

我的 .vimrc 中有这个:

I have this in my .vimrc:

xnoremap p pgvy

(注意:这仅适用于默认寄存器,但此映射很容易记住).编写一个更详细的版本是可能的.此外,您仍然可以使用 P 来获取旧行为.

(note: this will work only with the default register, but this mapping is easy to remember). Writing a more elaborate version would be possible. Also, you still can use P to get the old behaviour.

这篇关于多次粘贴的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆