Skip to main content

Undo in Vim (Linux)

Press u to undo the last change.

What it does

Each press takes back one more change. A change is everything done by one Normal mode command, or everything typed during one stay in Insert mode, so leaving Insert mode now and then gives smaller undo steps. Redo brings an undone change back. Vim keeps the history of changes for as long as the file is open.

The same shortcut on other platforms

PlatformShortcut
Linuxthis pageu
macOS

More Vim shortcuts: Editing

All 30 Vim shortcuts for LinuxThe full list has a search and a printable PDF.

Questions

What is the Vim shortcut for Undo on Linux?

u. Press it to undo the last change.

What is the shortcut for Undo in Vim on macOS?

On macOS it is U.