Here is a patch to Vim that adds a , register which is basically access to Vim's
internal 'redo buffer' used when '.' is used. At a quick look, it seems to work.
You can thus save your '.' commands to another register and replay them later:
:let @a=@,
@a
I believe @, will have pretty much the same functionality as . except that it
won't automatically change the count or the register number like . does (nor will
this happen if you save to another register, of course).
I wonder what Bram thinks about including this functionality in standard Vim? I
think it would be useful. What do others think?
Also, I haven't tested much. Testing and consequent feedback from others would be
worthwhile. There may be issues with things not being escaped which should be, etc.
Ben.
Send instant messages to your online friends http://au.messenger.yahoo.com
My apologies; that was a poor patch. And I thought I'd tested @, but trying it
again showed it didn't work. I have now made sure it doesn't work. The . command
is for that purpose, and implementing it isn't trivial!
Revised more robust patch attached.
Ben.
> My apologies; that was a poor patch. And I thought I'd tested @, but trying it
> again showed it didn't work. I have now made sure it doesn't work. The . command
> is for that purpose, and implementing it isn't trivial!
Just a thought: if I understand the patch correctly you're using ";
as a hidden internal register. Given that regname is an int, wouldn't
it make more sense to use a value that doesn't appear on the keyboard?
Then you don't take away the possibility of adding a "; register in
the future.
--
Matthew Winn
I would love to see this functionality in Vim. I miss it for very long
time. It's very typical when you go through a number of files doing "n."
Sometimes you need to do it across the session and I wanted the .
command be saved many times.
I vote for it!
I would love to see this functionality in Vim. I miss it for very long
Good plan. I'll define a constant.
I also realised I'll have to do some jiggerypokery to get redos involving visual
mode working. Visual mode needs to be entered with 1v, but only v is recorded in
the redo buffer (for technical reasons).
And I ignored the case of literal entry in insert mode, which I shouldn't have. So
a bit of work to do there still, too.
I should have done this one while a bit less rushed! My coding isn't usually this
poor...honest...