6

tvim でandを使用してf(または逆にTandを使用してF)前進することは可能ですが、単語をパラメーターとして使用することはできますか?

4

3 に答える 3

6

どう/wordですか?

他のものと同じように演算子と組み合わせることができます:

the lazy cow jumped over the high moon

開始時のカーソルd/highEnter:

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>

(注:エンターキー (^M) を<CR>意味します)C-vC-m

結果:

the lazy cow  moon
the hazy cow  moon
the noble cow jumped over the high moon
the crazy cow  moon

/eフラグは;のような包括的な動作を実現します。代わりに'tilf動作を取得するには:

: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
于 2011-09-26T12:30:54.950 に答える
2

*または#を使用して、カーソル下の単語のインスタンスを検索してみてください。パターンが に設定されていることに気付くでしょう。そのため\<foobar\>、そのようなパターンを使用して、単語境界文字で囲まれた目的の単語を見つけることができます。

于 2011-09-26T12:33:54.817 に答える
0

/wordおそらく、そのような検索に使用したいと思うでしょう。

set incsearchも役立つかもしれません。

于 2011-09-26T12:30:05.590 に答える