Vim Fundamentals

Vim is an incredibly powerful text editor that can be used for many tasks, from writing simple notes or emails to developing complex software projects. Whether you are an experienced coder or just getting started with programming, using Vim will help make your life easier: This cheatsheet is designed to save you time learning Vim!

vi vim cheatsheet

Vim (Vi IMproved) is a further development of the text editor Vi, which appeared in 1976. It is considered to be extremely flexible and customizable, which is why Vim is very popular even as an IDE.

Characteristic for Vim are the 3 working modes: Insert mode, Command mode and Visual mode (and the "normal" mode). Each mode is designed to fulfill specific purposes.

Modes in Vim

Insert mode - The actual editing mode. In insert mode, any keyboard input will be added onto whatever text is currently in the buffer.

Command mode - In command mode, you can enter various commands to perform actions such as saving files, copying and pasting text, searching for patterns, and more.

Visual mode - In visual mode, you can select and manipulate blocks of text. There are three types of visual mode in Vim:

Switching the modes in Vim

Starting from the normal mode switch to:

If you are not in the the normal mode:

To switch from one mode (like insert or command mode) to another mode (like visual mode), you should go back to normal mode first. This is usually done with the Esc key.

If you are in the command mode, you can cancel the command line and return to normal mode witch Esc or Ctrl + c.

Command Mode

The command mode in Vim is used for executing commands and performing various operations on your document.

Navigation is the normal mode

Basic Cursor Movement:

Word-wise Navigation:

Line Navigation:

Page Navigation: