

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