是否可以在 vim 中使用 t
继续前进?和 f
(或以另一种方式使用 T
和 F
),但使用单词作为参数?
最佳答案
怎么样/word
?
它可以像其他任何东西一样与运算符结合使用:
the lazy cow jumped over the high moon
光标在开始处,d/
high
进入:high moon
奖金
此外,您可能有兴趣学习一些像这样的 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>
(注意:
<CR>
表示回车键 (^M) 的 C-vC-m)结果:
the lazy cow moon
the hazy cow moon
the noble cow jumped over the high moon
the crazy cow moon
/e
旗达含行为类似于 f
;获取直到 行为代替::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
关于vim - 用 t 和 f move 光标,使用 word 作为参数,vim,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7555019/