Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/vim/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
用t和f移动光标,使用word作为参数vim_Vim_Cursor_Move_Forward_Words - Fatal编程技术网

用t和f移动光标,使用word作为参数vim

用t和f移动光标,使用word作为参数vim,vim,cursor,move,forward,words,Vim,Cursor,Move,Forward,Words,在vim中,是否可以使用t和f(或者以另一种方式使用t和f),但使用单词作为参数?您可能希望使用/word进行此类搜索 set incsearch也可能有帮助。关于/word呢 它可以像其他任何东西一样与操作员组合: the lazy cow jumped over the high moon 光标位于起始位置,d/高位输入: 奖金 此外,您可能有兴趣学习一些ex模式命令,如: the lazy cow jumped over the high moon the hazy cow jumped

在vim中,是否可以使用
t
f
(或者以另一种方式使用
t
f
),但使用单词作为参数?

您可能希望使用
/word
进行此类搜索


set incsearch
也可能有帮助。

关于
/word

它可以像其他任何东西一样与操作员组合:

the lazy cow jumped over the high moon
光标位于起始位置,d/
高位
输入:

奖金

此外,您可能有兴趣学习一些ex模式命令,如:

the lazy cow jumped over the high moon
the hazy cow jumped over the high moon
the noble cow jumped over the high moon
the crazy cow jumped over the high moon
现在进入

:g/azy/ norm! /jumped<CR>d/high/e<CR>
/e
标志实现了与
f
类似的包容性行为;要获得,请改为获得行为:

:g/azy/ norm! /jumped<CR>d/high/<CR>

尝试使用*或#搜索光标下单词的实例。您会注意到,它将模式设置为
\
,因此您可以使用这样的模式来查找您想要的单词,并由单词边界字符包围。

添加了额外的示例,因为重复这样做非常常见。您的示例很棒!但我没能理解ex-mode命令。然而,我一直在寻找的是将
/
(和
)与量词(和其他运算符)相结合!是的,ex命令真的结合了很多强大的工具:
:global
、命令范围、模式修改器。有时候,这就足够挑逗一点了——它会激发科技人员的好奇心,不是吗?现在完全理解这个例子了!什么是标准!谢谢你对边界的洞察,但仍然不是我想要的。谢谢。是的,我经常这样做,但我真的需要知道如何将其与移动和其他操作符结合起来。
the lazy cow  moon
the hazy cow  moon
the noble cow jumped over the high moon
the crazy cow  moon
:g/azy/ norm! /jumped<CR>d/high/<CR>
the lazy cow high moon
the hazy cow high moon
the noble cow jumped over the high moon
the crazy cow high moon