Join David D. Levine for an in-depth discussion in this video Working with undo, redo, and repeat, part of Learning vi.
…VI may be kind of prehistoric, but at least it does include Undo.…The u command, in command mode, undoes whatever the last change was.…If you press u again, it undoes the previous command, and so…on, back to the beginning of when you opened the file.…Control r is the opposite of undo.…It undoes an undo.…So it redoes the last change.…So if you type u u, it undoes 2 changes and then control r,…control r it redoes those 2 changes, returning you to where you had been.…
The shift u command undoes all changes that you…made since coming to the line on which the cursor is currently sitting.…And then finally, the period command repeats the last change you made.…Now it's important to note that the period command performs the same…transformation you just did in the current cursor location.…I'll note here that multiple undo and redo are a feature of vim,…the most recent version of VI.…If the VI that you're using is not based on the vim code base, then if you type u…it undoes that last command, if you type u again, it redoes it.…
AuthorDavid D. Levine
- Entering and leaving vi
- Understanding the Command, Insert, and Colon modes
- Moving around in files
- Editing text
- Moving content with delete, yank, and put
- Searching with regular expressions
- Customizing vi
- Filtering text through shell commands
Skill Level Beginner
1. Exploring vi
What is vi?2m 26s
2. Getting Started with vi
3. Moving Around within a File
4. Basic Text Editing
5. Undo, Repeat, Yank, and Put
6. Search and Replace
7. Advanced Editing Features
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.