Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am modifying a huge file with the same mod in many places. I know that I could use a macro, but actually using . do-again is easier for several reasons.

However, there is one place where I would like to make a small change, but I don't want to change what the . do-again key is doing. Is there a way to make this change without upsetting the operation of . do-again?

Alternatively, is there a way to store the operations of . in a register, and then restore from a register into .? Macros are just registers, so if I could store the contents of . in a register then I could probably run the macro once and then continue using . to rerun the macro.

Thanks!

share|improve this question
    
. always performs the last change: it's not a register that you can edit. You should be a little more precise about what changes you are repeating with ., why you don't use macros or other mechanisms and what is the nature of the smallest changes you want to perform without breaking .. –  romainl Aug 13 '12 at 20:57
    
Thanks, Romaint. I know that . is not a register but surely the keystrokes are stored somewhere. I do see the contents of the last insert under . when I run :reg but I cannot seem to copy them to another register. –  dotancohen Aug 14 '12 at 3:17
    
@. and . are not the same thing: hitting . will repeat the last change, whatever it is (~, for example), while @. (which is read-only) only stores the last inserted text. If your changes only involves insertion you should probably use named registers. –  romainl Aug 14 '12 at 5:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.