Somehow the dot "." command isn't repeating the last command for me. I'm searching a file for the string "xml" by issuing :/xml and vi, as expected, takes me to the next find. But now when I press "." nothing happens (the cursor stays exactly there), although if I do :/xml again, I'm taken to the next find.

What could be wrong?

2 Answers 2


The . command only repeats the last change (Normal Mode).

To repeat the last command-line, you can use @:

  • 1
    n also repeats the last search, and N (uppercase) repeats the last search in the opposite direction (up if you used / to search down, down if you used ? to search up) Jul 9, 2015 at 13:02

in vi and vim, when I search for a string I put


then if the first occurrence is not what I want, I just hit slash then enter

/ < enter >

and it takes me to the next occurrence of xml

  • You can just press n to go to the next match.
    – Heptite
    Jul 9, 2015 at 17:39
  • Indeed you can. thanks! Many ways to skin that pesky cat
    – eherr9633
    Jul 13, 2015 at 14:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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