What do the f and t commands do in Vim?

前端 未结 5 1174
青春惊慌失措
青春惊慌失措 2021-01-29 21:12

Can somebody explain to me what the f and t commands do in vim and exactly how they work? I can\'t seem to find this information but people keep telling me

5条回答
  •  北荒
    北荒 (楼主)
    2021-01-29 21:37

    Just to add to Michael Kristofik's answer, no description of f or t is complete without also mentioning ;.

    From this Vim cheat sheet:

    ; "Repeat latest f, t, F or T [count] times."

    So, to continue the @MichaelKristofik's theme:

    The quick brown fox jumps over the lazy dog.
    ^
    

    type fo to go to the first 'o':

    The quick brown fox jumps over the lazy dog.
                ^
    

    and then ; to go to the next one:

    The quick brown fox jumps over the lazy dog.
                     ^
    

提交回复
热议问题