Practice Exercise: Using vim
Objective
- Learn how to use vim in a Linux environment via
vimtutor
Task 1: vimtutor
- You may skip this Task if you have previously completed
vimtutor
-
In case you haven't, dive in to
vimtutor
by typing invimtutor
, then start from Lesson 1:[intern@intern-a1t-inf-lnx1 ~]$ vimtutor =============================================================================== = W e l c o m e t o t h e V I M T u t o r - Version 1.7 = =============================================================================== Vim is a very powerful editor that has many commands, too many to explain in a tutor such as this. This tutor is designed to describe enough of the commands that you will be able to easily use Vim as an all-purpose editor. The approximate time required to complete the tutor is 25-30 minutes, depending upon how much time is spent with experimentation. ATTENTION: The commands in the lessons will modify the text. Make a copy of this file to practice on (if you started "vimtutor" this is already a copy). It is important to remember that this tutor is set up to teach by use. That means that you need to execute the commands to learn them properly. If you only read the text, you will forget the commands! Now, make sure that your Caps-Lock key is NOT depressed and press the j key enough times to move the cursor so that Lesson 1.1 completely fills the screen. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 1.1: MOVING THE CURSOR ** To move the cursor, press the h,j,k,l keys as indicated. ** ^ k Hint: The h key is at the left and moves left. < h l > The l key is at the right and moves right. j The j key looks like a down arrow. v ... ... ...
-
Complete all lessons up to Lesson 7:
... ... ... ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 7 SUMMARY 1. Type :help or press <F1> or <Help> to open a help window. 2. Type :help cmd to find help on cmd . 3. Type CTRL-W CTRL-W to jump to another window 4. Type :q to close the help window 5. Create a vimrc startup script to keep your preferred settings. 6. When typing a : command, press CTRL-D to see possible completions. Press <TAB> to use one completion.
Conclusion
In this practice exercise, you've practiced using vim via vimtutor.