wowrt
wowrt

Reputation: 777

undo continually vi

I am using vi(not Vim) and I would like to continually undo the changes made. u works for a single command undo and Ufor 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

Upvotes: 4

Views: 844

Answers (2)

hhh
hhh

Reputation: 52840

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.

Upvotes: 1

Rob Farley
Rob Farley

Reputation: 15849

Repeat the undo, with the . key.

Upvotes: 1

Related Questions