undo continually vi
I am using vi(not Vim) and I would like to continually undo the changes made. u
works for a single comma开发者_Python百科nd undo and U
for a single line undo. But Is there a way to undo continuously like vim(I recall a command in vim can even undo changes by time!) in vi?
Thanks in Advance.
Edit: I am using vi version 3.10
Repeat the undo, with the .
key.
May not work in 3.1 version.
Undo continually things like stack-popping
u . . .
Suppose you write hello
in insert -mode. Go to normal mode, write hallo
and go to normal mode. Then type u .
, you get hello
. Type again .
and you will get blank. You can reverse it by typing again u . .
so you will get hello hallo
. It is very easy to memorize because it works like stacks! I.e. undo
repeat the last command
repeat the last command
where the repeat the last command can be undo
. When you press u u
, it does mean undo the last command
: undo last command
and the second u
means undo the last command and in this case it is u
.
Tested with Nvi Version 1.79 (10/23/96) The CSRG, University of California, Berkeley
, OpenBSD. You can get the source here.
精彩评论