From the course: Cert Prep: LPIC-1 Exam 101 (Version 5.0)

Unlock the full course today

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

Edit text in Vim

Edit text in Vim - Linux Tutorial

From the course: Cert Prep: LPIC-1 Exam 101 (Version 5.0)

Start my 1-month free trial

Edit text in 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 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 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. Then 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 escape 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…

Contents