Vim 101: Repeating Motions

In Vim 101: Repeating Commands I covered several ways of repeating a previous command. These techniques are great ways to speed up mundane editing operations. In the comments Richard Fabian suggested ; and , as well, which repeat the previously typed left-right motion: f, t, F or T.

The left-right motions are seriously worth adding to your permanent muscle memory, so let's recap how they work:

  • f{char} -- Move to the next {char}
  • F{char} -- Move to the previous {char}
  • t{char} -- Move before the next {char}
  • T{char} -- Move after the previous {char}

All of these motions take an argument as well. After one has been issued, pressing ; will repeat it in the same direction, while , repeats it in the opposite direction.

blog comments powered by Disqus