RE: repeating action between marks
>Say for example I'd like to indent the text between lines 10-20. I'd
>like to use marks points to indicate the lines through which to
>repeat the last action I performed on a single line (in this case an
>indentation), how would I do that?
>I know I could for example do some regex like this:
>:'a,'bs/^/ /
>and clearly I can do this with a visual selection.
>but how could I repeat the last action I performed over two marks:
>:'a,'b<something goes here to indicate 'repeat last action'>
'&' is a good start.
Eg, if I use a 's///' command on one line just to see if it works as
expected, I can repeat it through the entire file with
:g//&
:.,$&
:15,20&
etc., and it'll redo the 's///' command on the rest of the file or
whatever limits you impose.
If you do a non-'s///' command, eg, ":10,30>" to indent lines instead,
you can look for patterns, etc., and do things like
:/beginpattern/,/endpattern/>
too.
Not quite sure if that's what you were asking about, but if not, just
yell back...