选择垂直块后如何在光标前粘贴? [英] How to paste before the cursor after selecting a vertical block?

查看:79
本文介绍了选择垂直块后如何在光标前粘贴?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很确定这个必须存在,但是如果不存在,那么可能有一个宏...

I'm so sure that this must exist, but if it doesn't maybe there is a macro for it...

我最喜欢的vim功能之一是在可视模式下插入(<C-v>,选择行,<C-I>,键入一些内容,然后输入 Esc ).

One of my most favourite features of vim is the insert before when in visual mode (<C-v>, select the lines, <C-I>, type a little, then Esc).

我的问题是我想粘贴剪贴板内容而不是插入".我尝试了<C-P>但没有爱.

My issue is that I want to paste the clipboard contents before, not 'insert'. I tried <C-P> but no love.

我阅读了备忘单,在各处搜索,浏览了这里的问题,但没有找到它,但是我肯定是在寻找错误的东西.

I have read cheat sheets, searched everywhere, looked through the questions on here and haven't found it, but I could definitely be searching for the wrong thing.

推荐答案

我假设您的意思是在可视块模式下使用I在多行上插入相同的文本,点击p只是将其粘贴在当前行上而不是所有选定的行.

I assume you mean using I in visual block mode to insert the same text on multiple lines, where hitting p simply pastes on the current line rather than all the selected lines.

在插入模式下,您可以按C-r键,然后按一个寄存器以插入该寄存器的内容,因此,如果要粘贴未命名的缓冲区,请输入

In insert mode, you can hit C-r followed by a register to insert the contents of that register, so if you wanted to paste the unnamed buffer, you'd enter

C-r"

类似地,要从剪贴板粘贴

Similarly, to paste from the clipboard

C-r* 

通过像平常一样输入插入,然后使用C-r,您将在所有选定行上获得文本.

By entering insert as you normally would, then using C-r, you'll get the text on all of the selected lines.

看看:h registers可以使用哪些寄存器.

Take a look at :h registers to see what registers are available to you.

这篇关于选择垂直块后如何在光标前粘贴?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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