vi Undo命令

一、概述

vi Undo命令:u和U。其中,u为撤销最后一条命令,U为当光标在当前行时,撤销该行所有操作。(引自《Learning the vi and Vim》)

二、示例

step4,键入命令U,文本回滚至step3;

step11,键入命令U,文本回滚至step10,由于该step无step_undo,step12键入命令u,vi提示Already at oldest change。

step    command step_undo       context

0

1       i       0       abc

2       x       1       bc

3       x       2       c

4       U       3       

5       u       2       c

6       u       1       bc      

7       u       0       abc

8       x       7       bc

9       u       0       abc

10      u

11      U       10      c

12      u

三、结论

《Learning the vi and Vim》中将U定义为当光标在当前行时,撤销该行所有操作,该定义不准确。

posted on 2017-08-12 15:52  佛哥  阅读(1500)  评论(0编辑  收藏  举报

导航