Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more

Question about navigation in the undo history, undoing, and redoing changes

From :h undo

The last changes are remembered. You can use the undo u and redo CTRL-R commands to revert the text to how it was before each change. You can also apply the changes again, getting back the text before the undo.

The "U" command is treated by undo/redo just like any other command. Thus a "u" command undoes a "U" command and a 'CTRL-R' command redoes it again. When mixing "U", "u" and 'CTRL-R' you will notice that the "U" command will restore the situation of a line to before the previous "U" command.