Vim offers more modes than the original vi (which offers only the "normal", "insert" and "command–line" modes). These additional modes make vim more powerful and easier to use; because of this, vim users should at least be aware that they exist. (NOTE: If you ever enter a mode you are unfamiliar with, you can usually press ESC to get back to normal mode.)
Here is a short overview of each mode available in vim:
|Mode Name||Description||help page|
|normal||For navigation and manipulation of text. This is the mode that vim will usually start in, which you can usually get back to with ESC.||
|insert||For inserting new text. The main difference from vi is that many important "normal" commands are also available in insert mode - provided you have a keyboard with enough meta keys (such as Ctrl, Alt, Windows-key, etc.).||
|visual||For navigation and manipulation of text selections, this mode allows you to perform most normal commands, and a few extra commands, on selected text.||
|command-line||For entering editor commands - like the help commands in the third column.||
Each mode is described below.
Open a console terminal from your Linux operating system, and enter vi .
You are now in Normal mode - also referred to as Command mode, because we enter commands from this mode. This is where vim normally starts. If you have text, you can move around with your arrow keys or other navigation keystrokes (which you will see later). To make sure you are in Normal mode, simply hit the Esc (Escape) key.
Tip: Esc switches to Normal mode. Even though you are already in Normal mode, hit Esc just for practice's sake. This is what a new file would look like; if you opened an existing file you would see the content of the file.
Now, this will be interesting. Press : (the colon key) followed by q! (i.e., :q!). Your screen will look like this:
Pressing the colon in Normal mode switches vim to Command Line mode, and the :q! command quits (q) without saving (!). In other words, you are abandoning all changes. You can also use ZQ - choose whichever option is more convenient.
A brief look at the other modes continues in the following pages.