Vi query

brown at nicmad.UUCP brown at nicmad.UUCP
Thu Sep 5 12:54:54 AEST 1985


In article <442 at cuae2.UUCP> cwd at cuae2.UUCP (-Chris Donahue) writes:
>After using the "/" command in VI to find the first instance of a string, using
>the "n" command will find the next instance. (And of course "." will repeat the
>last command issued).

Careful!  The way you worded the above, it sounds as if you can use the '.'
command to repeat the last 'n' command.  That is not so.  The '.' will repeat
the last text editing command.  If you are looking for a word like 'their'
and you wanted to find them and change them to 'there', you could first do a
'/their' to find the first one, then use the 'cwthere' command to change
the word.  The 'cw' is the 'change word' command.  Use the 'n' to find the
next word and use the '.' to change it to 'there'.  If you don't want to
change the word that it finds, just press 'n' again.

So, as you notice in the example, the '.' will repeat the 'cw' command,
not the 'n' search command.  A powerful feature that I use alot.
-- 

Mr. Video   {seismo!uwvax!|!decvax|!ihnp4}!nicmad!brown



More information about the Comp.unix mailing list