Bookmark this page

Practice: Basic vim Workflow

In this lab, you will edit a text file using vim.

Resources
Machines: desktopX

Outcomes

A successfully edited text file.

A working student account on desktopX.

  1. Log into your desktopX system as student and open a terminal.

  2. Open the (new) file /home/student/vim-practice.txt in vim. You do not have to create this file first.

    1. [student@desktopX ~]$ vim vim-practice.txt
  3. Insert the following text:

    This is my vim practice file.
    There are many like it, but this one is mine.
    1. Press i or a to go into insert mode.

    2. Type the text shown previously.

    3. Press Esc to go back into command mode.

  4. Insert a new line at the bottom with the following contents:

    More lines, I want more lines!
    1. Press o to open a new line beneath the current one and immediately switch to insert mode.

    2. Type the line to be added.

    3. Press Esc to go back into command mode.

  5. Save and quit your file.

    1. From command mode, enter :wq, then press Enter.

Revision: rh134-7-c643331