When I do something like:

  • f G

To find the next G on the line, I can press ; to find the next occurrence. However, once I've passed one, is there a way to find the previous occurrence? Likewise with doing capital F G ?

  • 3
    Just out of curiosity, why not :h ; and on the next line find , ? – B Layer May 3 '20 at 1:23
  • 1
    @BLayer I guess that, ultimately, every single question has got to be asked at a certain point in time... – Biggybi May 3 '20 at 1:35
  • @Biggybi Heh. I would counter with an earlier question asking the same thing but haven't found one yet (though I've found a number that contain the answer such as vi.stackexchange.com/questions/2307/… ) – B Layer May 3 '20 at 1:39
  • @BLayer It looks like vim's complexity together with the many ways to phrase a question makes this forum virtually infinite (I hope my English is at least understandable). I'll sleep on it, good luck finding a duplicate! – Biggybi May 3 '20 at 1:56
  • @Biggybi Understandable sentiment about this place. From the standpoint of the question asked here Vim's help is the polar opposite....doesn't get much easier. Cheers. – B Layer May 3 '20 at 2:05

The opposite of ; is , to find the previous occurrence.

It works with both t and f searches.

Of course, this will be inverted with T and F.

Thus, to go backwards, you could choose to only use t and f together with , : this is as many keystrokes as using capital letters and keeps cycling consistent in every case.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.