|
Introduction to Vim
|
Vim is a text editor - not a word processor. The difference being that a file created with a text editor contains no extra data to influence its visual presentation. For this reason, any file containing code to be executed by the operating system must be created using a text editor.
While there are many text editors, Vim is the most powerful in terms of functionality, and also the least reliant on system specifications. It is therefore regarded as the editor of choice for the Linux professional.
Before attempting the exercises in this chapter, learn
the basics of Vim by running
vimtutor <ENTER>
and following the instructions.
It will take between 25 and 30 minutes.
Subsequently, it may be helpful to keep this quick reference card open in a web page while you work.
There are eleven types of mode when running Vim, but they can be categorised as two types: normal modes and insert modes.
Normal mode: When you start Vim you will be in normal mode, and at any time you can return to the normal mode by pressing the <ESC> key at the top left-hand side of your keyboard.
Insert mode: There are many ways to enter the insert mode, but the simplest is to type i. After typing i all the characters you type will be inserted into the docuement.
To exit Vim and return to the command-line: