Vim Tutorial

Learn Vim properly: modes, motions, operators and text objects, search and replace, registers and macros, buffers and windows, configuration, and real-world workflows.

Vim is installed on nearly every Unix-like system, it is the default editor for git commits on many machines, and it is often the only editor available over SSH or inside a container. Its modal design turns editing into a small language — operators, motions and text objects — that becomes very fast once it clicks.

This path starts with surviving your first session (including how to quit) and moves through navigation, editing, the operator-and-text-object grammar, search and replace, and Visual mode. Later articles cover buffers, windows and tabs, Ex commands and :global, registers and macros, building your own vimrc with plugins, and complete workflows such as project-wide refactoring, git rebases and fixing compiler errors with the quickfix list. Every keystroke example was verified in Vim 9.1.

What You'll Learn

  • Getting Started
  • Core Editing
  • Power Features
  • Customization and Workflows

12 tutorials · Beginner to advanced · Exercises with solutions in every article · Free, no sign-up

Start here

Introduction to Vim

What Vim is, why it is on nearly every server you will log in to, how modal editing works, how to get out of it, and a first five-minute session.

Section 1. Getting Started

Start here to learn the Vim basics.

  • —Introduction to Vim – What Vim is, why it is on nearly every server you will log in to, how modal editing works, how to get out of it, and a first five-minute session.
  • —Installing Vim and Learning with vimtutor – Check which Vim build you have, install a full one on Linux, macOS or Windows, make it the editor Git and cron use, and get started with vimtutor.
  • —Modes and Moving Around – Vim's five modes and how to switch between them, then every motion you need: words, lines, characters, paragraphs, screens, marks and the jump list.

Section 2. Core Editing

  • —Editing Text: Insert, Delete, Change, Undo – The everyday Vim edits on real config, CSV and Python files: entering Insert mode, deleting, changing, copying and pasting, undo and redo, the dot command, and saving.
  • —Operators, Motions, and Text Objects – Vim's editing grammar: operators like d, c, y, gU and = combined with motions and text objects such as iw, i(, i" and it, shown on real code.
  • —Search and Replace – Searching with / and *, safe find-and-replace with :s and its flags, the Vim regex you actually need, and renaming across a project with :vimgrep and the quickfix list.
  • —Visual Mode – Select text with v, V and Ctrl-V and then act on it: block inserts and appends, column edits, ranges, and when an operator is the better tool.

Section 3. Power Features

  • —Buffers, Windows, and Tabs – How Vim juggles many files at once: buffers, windows and tab pages, the argument list, splits, :bufdo and :argdo, and opening files from the shell.
  • —Ex Commands, Ranges, and :global – Edit whole regions of a file from the command line: line ranges, :d :m :t :j and :normal, the :global command, :sort options, and filtering text through shell tools.
  • —Macros and Registers – Vim's registers explained one by one, from the yank register to the expression register, then recording, editing and running macros across lines and files.

Section 4. Customization and Workflows

  • —Configuring Vim: vimrc, Mappings, and Plugins – Build a vimrc you understand: where Vim loads it from, options, per-filetype settings, safe mappings and commands, a commented starter file, and plugins as native packages.
  • —Real-World Vim Workflows – Tested, step-by-step Vim workflows for daily engineering work: server configs and swap recovery, Git commits and rebases, project-wide replace, :make, merge conflicts, sessions, big files.