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

Nil*_*oct 5 vim words move cursor forward

是否有可能在Vim在前进tf(或用其他方式TF),但使用的话作为参数?

seh*_*ehe 5

怎么样/word

它可以像其他任何东西一样与运算符组合:

the lazy cow jumped over the high moon
Run Code Online (Sandbox Code Playgroud)

光标在开始时,d/highEnter:

high moon
Run Code Online (Sandbox Code Playgroud)

奖金

此外,您可能有兴趣学习一些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
Run Code Online (Sandbox Code Playgroud)

现在进入

:g/azy/ norm! /jumped<CR>d/high/e<CR>
Run Code Online (Sandbox Code Playgroud)

(注意:<CR>表示C-vC-m输入键(^ M))

结果:

the lazy cow  moon
the hazy cow  moon
the noble cow jumped over the high moon
the crazy cow  moon
Run Code Online (Sandbox Code Playgroud)

/e旗实现包容像行为f; 为了得到'直到行为:

:g/azy/ norm! /jumped<CR>d/high/<CR>
Run Code Online (Sandbox Code Playgroud)

结果:

the lazy cow high moon
the hazy cow high moon
the noble cow jumped over the high moon
the crazy cow high moon
Run Code Online (Sandbox Code Playgroud)