[Next] [Up] [Previous] [Contents]
Next: Vi reference Up: Command mode Previous: Undo

Repeat

Often times you may desire to repeat the last command performed. This can be done with the ``.'' command. Place the cursor in the appropriate position and press ``.'' to repeat the most recent command. Suppose I had a C program in which I wished to switch a variable name from no_way to yes_way in two different places. One way I could accomplish this would be to place my cursor on the beginning of the first no_way and type cw (change word) and then type yes_way <esc>. This would accomplish my task for the first case. Now all I would need to do to change the second no_way would be to place my cursor at the beginning of it and type ``.'' to repeat the last command.


c.c.taylor@ieee.org