vi Undo 命令,viundo命令


一、概述

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 定义为当光标在当前行时,撤销该行所有操作,该定义不准确。

相关内容

    暂无相关文章