Skip to content
BENIBIX Learn

Vim

Development🛠️ Editors & ToolsEditors

Also known as Vi IMproved, Vim Editor, vi editor

A free editor that runs in a terminal. You work it with keys, not a mouse.

Think of it like

It is like a piano. Each key does a job, and your hands stay on the keys.

Example

Jack logs in to a server to fix one setting. The server has no window apps, so he opens the file in Vim, changes the line and saves.

Why it matters

It is there on almost every server. Knowing a few keys means you can fix a file anywhere, with no other app.

Definition

Vim is a free text editor that runs inside a terminal. It is an improved copy of vi, an older editor found on most Unix systems. Vim has modes. In normal mode, each key is a command, so dd deletes a line. In insert mode, keys type text as in any editor. You never need the mouse, so practised users edit very fast.

Example code

vim
$ vim notes.txt
i      start typing (insert mode)
Esc    back to normal mode
:wq    write the file and quit
Open a file, press i to type, press Esc, then :wq to save and leave.
Vim swaps between two modes. One is for commands, one is for typing.

Common mistake

Typing words while still in normal mode, so each letter runs as a command. Press i first, and Esc when done.

Key takeaways

  1. 1
    Modes. Keys mean one thing in each mode.
  2. 2
    Keys, not mouse. Every action has a key for it.
  3. 3
    Everywhere. It is found on almost every server.

Compare

Learn it properly