From the course: CompTIA Linux+ (XK0-005) Cert Prep

Unlock the full course today

Join today to access over 24,300 courses taught by industry experts.

Edit text in Vim

Edit text in Vim

- [Instructor] Let's talk about editing text in Vim. We'll start Vim with a new text file. Type in vim space editfile.txt and hit Enter. Now it's going to insert mode by pressing the I key and add some text. Line one, two, and three. We'll copy and paste which Vim calls yank and put, as well as cut and paste which Vim calls delete and put. Go to normal mode by pressing the Escape key. To copy a letter, type YL a word, type YQ and to copy a line, type YY. Now put your cursor over the word one and press YW. Now go to the end of the line and press P to put. Now put your cursor over the second line and press YY, followed by P. Now you should have two line twos. To cut or delete a letter, type DL; for a word, type DW; and for a line, type DD. Whenever you delete text in Vim, it places it in the clipboard similar to cutting text in other editors. Put your cursor over line one and press DD. Now go to the end of the file and…

Contents