带`p`的粘贴粘贴块与下面的行混合 [英] Paste yanked block with `p` gets mixed with lines below

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

问题描述

如果我用 Ctrl + V Shift + $ 复制3行,然后转到另一个窗口并用 p 粘贴,这些行混合了。

If I copy 3 lines with Ctrl+V, Shift+$ and then go to another window and paste with p, the lines get mixed.

我该如何将被拖拉的块粘贴为新行,所以旧行会移到下面

How can I paste the yanked block as new lines, so the old lines move below instead of get mixed with the pasted ones?

推荐答案

Ctrl-V 在正常模式下,您将切换到V块模式,在该模式下,文本将逐段复制(位置相对固定)。

When you press Ctrl-V in normal mode, you are switched into the V-BLOCK mode where the text will be copied blockwise (with relatively fixed position).

@PeterRincker在评论部分提供了一种非常简单的方法,您可以通过以下方式将带阴影的块 linewise 放入:

@PeterRincker gave a very easy way in the comments section, you can put the yanked block linewise by:

:put




:[line ] pu [t] [x] 将[x寄存器中的文本]置于[line](默认当前行)之后。

这总是| linewise |,因此此命令可以用来将拉出的块作为新行。

:[line]pu[t] [x] Put the text [from register x] after [line] (default current line).
This always works |linewise|, thus this command can be used to put a yanked block as new lines.






下面是我的原始答案,这需要更多步骤。


Below is my original answer, which takes much more steps.

一种不太整洁但实用的粘贴方式 linewise

A not very neat yet practical way to paste it linewise:


  • :new 创建新缓冲区

  • p 粘贴

  • Shift + V + G 选择所有文本

  • y 复制

  • :new to create a new buffer
  • p to paste
  • Shift+V+G to select all text
  • y to copy

现在您将获得复制文本的普通形式。

And now you get the normal form of the copied text.

这篇关于带`p`的粘贴粘贴块与下面的行混合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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