123456XP 发表于 2012-12-19 19:13

VIM怎么获取搜索的字?

我的"字word"很长,按住*或者#号时,会向前/后搜索它,此时"字word"会高亮起来。

我想替换它
:% substitute /字word/Other/g

因为"字word"很长,硬输入比较耗时,又不能用Tab间补全,有什么办法能提取它么?

crazyhadoop 发表于 2012-12-19 21:36

复制粘贴行么

123456XP 发表于 2012-12-20 08:18

这种情况下,赋值+粘贴要用鼠标选中,然后 + ,速度比直接输入慢的。

123456XP 发表于 2012-12-21 10:26

用英文:vim substitute last search word在google上找到了。
只需要: % substitute //Other/g
或者: % substitute /<C-R>/时上次搜索的"字word"会呈现出来。也就是按Ctrl+R键后按/键。

参考:http://vim.wikia.com/wiki/Substitute_last_search

udevu 发表于 2012-12-25 23:45

回复 4# 123456XP
顶,又学一招


   

lrita 发表于 2012-12-26 19:03

shift+insert 没用过么
页: [1]
查看完整版本: VIM怎么获取搜索的字?