Undo in Vim (macOS)
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
| Platform | Shortcut |
|---|---|
| macOSthis page | U |
| Linux |
More Vim shortcuts: Editing
- Redo
- Repeat Last Command
- Delete Line
- Yank Line
- Paste After
All 38 Vim shortcuts for macOSThe full list has a search and a printable PDF.
Questions
What is the Vim shortcut for Undo on macOS?
U. Press it to undo the last change.
What is the shortcut for Undo in Vim on Linux?
On Linux it is u.