From the course: Red Hat Certified System Administrator (EX200) Cert Prep: 1 Deploy, Configure, and Manage (2021)

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Editing text with vim

Editing text with vim

- [Instructor] 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 edit file dot 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 Escape + U. Pressing Escape takes us out of insert mode and into command mode. Pressing U will undo the changes. Press Escape + U. You can see our three lines are now gone. To redo a change, go to command mode and press Control + R. So press Escape again and then press Control + R and then we can see that we redid the changes. Now let's talk about editing in Vim. We'll cut, copied, delete, and paste in command mode. Move your cursor to a line of text and press Escape to go to command mode. To cut text we'll use this C key. To cut a letter we'd type CL, to cut a word we'll type…

Contents