Practice Using the Vim Help System

#### Goal:

The goal of this exercise is to get experience using the built-in vim help system.

#### Instructions:

#### Open the help.txt file

First, start a command line session on your local machine. Next, use vim to open the "help.txt" file that came in the course downloads. To do that, navigate to the location of the file. Remember this could be different for you depending on where you extracted the contents of the file. This example assumes the course download was saved into your Downloads folder and extracted from there.

cd Downloads cd vimclass vim help.txt

#### Start the help system

Start the help system by typing :help<ENTER>. Read the text on your screen. Remember that this is a simple text file.

#### Close the help system

Exit out of help by typing :q<ENTER>.

#### Start the help system again

Start the help system by typing :h<ENTER>. Many times there are shortened or abbreviated version of commands. In this example, :h is the same as :help.

Read the help on some of the commands you already know

You already know several vim commands. Use the help system to get information on the following commands. Read the related documentation to refresh your memory about each command.

:h i

:h :wq

:h :q

:h Ctrl-f

:h ^f# Note, using a caret symbol is the same as "Ctrl".

# So, ^f and Ctrl-f are the same.

:h ^b

:h w

Practicing jumping through the help system

Look up the documentation on the W command by typing :h W<ENTER>. Position your cursor under the world "exclusive". Type Ctrl-] to jump to the documentation for "exclusive." Once you've done reading, jump back to your previous location in the help system by typing Ctrl-o.

Now move your cursor below the word "count". Type Ctrl-] to jump to the count documentation. When you are finished reading about count, type Ctrl-o to return to your previous position.

Determine the equivalent command for Ctrl-G

Look at the documentation for Ctrl-G by typing :h ^g<ENTER>. Can you tell what other command or commands are the same as Ctrl-G? That's right, :f and :file. Try it now by typing :f<ENTER>. Notice the line of text that appears at the bottom of your screen. It shows you the name of the help file you're viewing.

Switch back to the file you're editing

Type Ctrl-w-w. (Hold down the Ctrl key and type w twice.) Your cursor is now in the bottom window that contains the help.txt file you opened at the beginning of this exercise. Confirm this by typing Ctrl-g or by using the :f or :file commands.

Your turn

Switch back to the help window by typing Ctrl-w-w. Think of some commands you've learned in the course. Use the help system to look up the documentation for those commands. Feel free to explore as much or as little as you like.

Finishing up

When you're done, exit out of the help system by typing :q<ENTER>. To stop editing the help.txt file and exit the vim editor use :q!<ENTER>.