Vim undo rollback

Press u in vi to undo an operation

uUndo    the operation of the previous step  Ctrl+r  to restore the operation that was undone in the previous step
     

Note:
        If you type "u" twice and your text returns to its original state, then your Vim should be configured in Vi compatibility mode.
        Redo
If you undo too much, you can type CTRL-R (redo) to go back to the previous command. In other words, it undoes an undo. To see an example of execution, type CTRL-R twice. The character A and the space after it appear:
young intelligent turtle
has a special version of the undo command: "U" (line undo). The line undo command undoes all operations on the previous edit line
. Enter these commands twice to cancel the previous "U":
A very intelligent turtle
xxxx delete very
A intelligent turtle
xxxxxx delete turtle
A intelligent
restore line with "U"
A very intelligent turtle
use "u" to undo "U"
A intelligent
"U" Commands to change themselves, "u" to undo an operation, and CTRL-R to redo an operation. It's a bit messy, but don't
worry, with the "u" and CTRL-R commands you can switch to any state.

Popular text editors often have forward and backward functions to move back and forth between positions in the file that you have browsed. In vim use Ctrl-O to go back and Ctrl-I to go forward.

Related help: :help CTRL-O :help CTRL-I :help jump-motions


Reprint address: http://blog.csdn.net/xiongzhengxiang/article/details/7206691

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326314658&siteId=291194637