在 Vim 中,有没有办法在搜索行中粘贴文本? [英] In Vim, is there a way to paste text in the search line?

查看:24
本文介绍了在 Vim 中,有没有办法在搜索行中粘贴文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想搜索 $maximumTotalAllowedAfterFinish 并将其替换为 $minimumTotalAllowedAfterFinish.而不是输入长文本:

I want to search for $maximumTotalAllowedAfterFinish and replace it with $minimumTotalAllowedAfterFinish. Instead of typing the long text:

:%s/$maximumTotalAllowedAfterFinish/$minimumTotalAllowedAfterFinish/g

有没有办法将这些长变量名复制到搜索行中,因为在命令行上我无法输入p"进行粘贴?

Is there a way to COPY these long variable names down into the search line, since, on the command line I can't type "p" to paste?

推荐答案

您可以通过键入 CTRLR <来插入编号或命名寄存器的内容代码>{0-9a-z"%#:-=.}.通过键入 CTRL-R CTRL-W,您可以粘贴光标下的当前单词.参见:

You can insert the contents of a numbered or named register by typing CTRLR {0-9a-z"%#:-=.}. By typing CTRL-R CTRL-W you can paste the current word under the cursor. See:

:he cmdline-editing

了解更多信息.

这篇关于在 Vim 中,有没有办法在搜索行中粘贴文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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