Join David D. Levine for an in-depth discussion in this video Changing text, part of Learning vi.
…Now I'll talk about vi commands that change text.…The command r changes the current character,…which is to say the character the cursor.…The command s also changes the current character.…The difference between r and s is that if you type r and then another character,…the new character that you just typed replaces the current character, but…you're still in command mode.…Whereas if you type s and then another character, the new character…replaces the current character at the cursor, but now you're in insert mode.…So, r leaves you in command mode, s leaves you in insert mode.…
The rest of these commands leave you in insert mode.…cc changes the current line, which is to say,…it deletes the contents of the current line and leaves you in insert mode.…cw changes the current word, which is to say, it deletes the current word and…leaves you in insert mode.…Unlike the w command, the cw command actually only changes to the end of…the current word, it's exactly the same as ce.…You can use c^ to delete from here to the beginning of the line and enter…
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.