Editing text usually comprises of cutting, copying, deleting, and pasting text. In Vim these are called cut, yank, delete, and put. Vim gives us the power to select text by letter, word, line, or any number of each.
- [Teacher] Before we start talking…about editing text in Vim,…let's talk about undo and redo.…Let's start Vim with a new text file,…by typing vim space editfile.txt…and hitting enter.…Go into insert mode by pressing "i"…and add some lines.…I've added line one, line two, and line three.…If we want to undo changes, we'll need to press esc + u.…Pressing esc takes us out of insert mode…and into command mode.…Pressing "u" will undo the changes.…
Press esc + u.…You can see our three lines are now gone.…To redo a change, go to command mode and press ctrl + r.…So press esc again and then press ctrl + r.…And we can see that we redid the changes.…Now let's talk about editing in Vim.…We'll cut, copy, delete, and paste in command mode.…Move your cursor to a line of text,…and press esc to go to command mode.…To cut text, we'll use the "c" key.…To cut a letter, we'll type "cl".…
To cut a word, we'll type "cw".…And to cut a line we'll type "cc".…For this demonstration, type "cc".…You'll notice that we cut the line that's no longer visible.…
- Learning Linux command syntax
- Getting help on the CLI and GUI
- Finding help online
- Using basic commands
- Navigating file systems
- Editing text
Skill Level Intermediate
Linux: Bash Shell and Scriptswith Kevin Dankwardt2h 46m Intermediate
Setting up a Red Hat Enterprise Linux Serverwith Sandra Toner2h 46m Intermediate
1. Getting Help
2. Using Basic Commands
3. Navigating File Systems
4. Editing Text
- 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.