粘贴多次 [英] Paste multiple times

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

问题描述

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

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

我遇到的问题是当我在一条线上划线,并将其粘贴到另一条线上时,yank被替换为刚刚替换的线。现在,如果我想用同一行替换另一行,我必须回去,再次.ank。

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.

这是一个更好的方法。

推荐答案

我在我的.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天全站免登陆