Learn Practice Daily golf Reference
Guides · Learning Vim

Vimtutor: what it teaches, how to start it, and what comes next

Vimtutor is the free, hands-on tutorial that comes with Vim: type vimtutor in a terminal (in Neovim, run :Tutor) and you edit a practice copy of the lesson file as you read it. Chapter one takes about 30 minutes and covers moving, deleting, changing, undo, search, substitute and saving. It is the best first half hour you can spend on Vim, but it stops before the habits that make Vim fast.

Vimtutor at a glance
VimNeovim
How to start vimtutor in a terminal :Tutor inside Neovim
Chapter one 7 lessons, about 30 minutes 7 lessons, same ground
Chapter two vimtutor -c 2: text objects, registers, marks (8 to 10 minutes) vim-02-beginner, linked at the end of chapter one
Checks your work No, you compare by eye Yes: a ✗ beside a line turns into ✓ when it is right
Price Free, installed with Vim Free, installed with Neovim

What vimtutor is

Vimtutor is a plain text file and a small launcher. The launcher copies the tutorial into a temporary file and opens it in Vim, so you can delete, change and break whatever you like: the original is untouched, and running vimtutor again gives you a fresh copy.

That is the whole idea, and it is a good one. You read an instruction, move the cursor to the exercise line under it, and do the edit right there. Nothing is simulated: it is the real editor you will use afterwards, with the real keys. Vim's own user manual describes it as a 30-minute tutorial that teaches the most basic Vim functionality hands-on.

How to start it

  • macOS and Linux: open a terminal and type vimtutor. If Vim is installed, the tutorial opens straight away. If the command is missing, install your system's full vim package; some systems ship only a minimal vi.
  • Windows: the Vim installer adds it. Vim's manual says you can find it in the Vim entry of the Start menu ("Program/Vim 9.1"), or run vimtutor.bat from the installation folder.
  • Neovim: start nvim and run :Tutor. With no argument it opens vim-01-beginner, which the Neovim docs describe as the equivalent of vimtutor. Press Tab after :Tutor to list the other tutorials it can find.
  • Chapter two: vimtutor -c 2 in Vim. In Neovim, follow the link at the end of chapter one.

To leave at any point, press Esc and type :q! then ↵. Lesson 1.1.2 teaches exactly that, so you will only be stuck for a minute.

Practise the keys

The keys vimtutor makes you learn first

Getting in and out comes before anything else. Type the keys for each, as you would in Vim; nothing here quits anything.

You are typing in Insert mode. Get back to Normal mode.
scroll here, then press the keys
1 of 5
You are typing in Insert mode. Get back to Normal mode.

What the lessons cover

Chapter one of Vim's tutor (version 1.7) has seven lessons, each with a short summary at the end:

  • Lesson 1.1: moving the cursor with h j k l, exiting Vim, deleting with x, inserting with i, appending with A, and editing a file.
  • Lesson 1.2: deletion commands (dw, d$, dd), how operators and motions combine, counts for motions and for deletes, and undo with u and Ctrl-r.
  • Lesson 1.3: put with p, replace with r, the change operator c and more changes with it, such as ce.
  • Lesson 1.4: cursor location and file status with Ctrl-g, searching with /, matching parentheses with %, and the substitute command :s/old/new/g.
  • Lesson 1.5: running an external command with :!, writing files, writing a selection, and reading a file in with :r.
  • Lesson 1.6: opening lines with o and O, appending with a, Replace mode with R, copy and paste with y and p, and setting options such as :set ic.
  • Lesson 1.7: getting help with :help, creating a startup file (a vimrc), and command-line completion.

Chapter two is shorter, about 8 to 10 minutes: text objects, the named registers, the expression register, the numbered registers, the special registers, and marks. It ends there.

Neovim's :Tutor follows the same seven lessons with slightly different numbering, swaps the vimrc lesson for one on configuring Nvim, and adds a lesson 0 that explains its check marks.

Try it here

Lesson one, in our own words

The kind of exercise vimtutor opens with, on a text of our own: delete stray letters with x, append with A, insert with i, and delete a doubled word with dw. Move with h j k l or anything else you know, and press Esc after typing.

1 of 5Vimm has one m too many: put the cursor on the extra m and press x
1Vimm is a text editorr
1It has modes
2You learn it it by doing
NORMALLoading the editor…1/50.0s1:1

This editor needs a keyboard. Read on, and play it at your computer.

How long it really takes

The tutorial says 30 minutes for chapter one, and that assumes you do every exercise as you go. Stopping to experiment takes longer and is time well spent. Chapter two says 8 to 10 minutes.

The catch is that finishing it is not the same as knowing it. Thirty minutes is enough to understand dw and cw, not to reach for them without thinking. Running it a second time a day or two later costs another half hour and is the cheapest way to make the basics stick.

What vimtutor doesn't cover

Vimtutor is a first lesson, not a course. Things you will meet in every day of real editing that it skips or only touches:

  • The dot command. . repeats your last change, and most of Vim's speed comes from setting up changes so that . can repeat them. Vimtutor never mentions it.
  • Text objects in depth. Chapter two introduces them, but ci", da(, cit and the rest take practice before they become reflexes.
  • Word motions and finding within a line. f, t, ; and , are among the most useful keys in Vim and get no lesson.
  • Visual mode. It appears only as a way to select text to write to a file. Visual block mode (Ctrl-v) is absent.
  • Macros. Recording with q and replaying with @ is not covered at all.
  • Search as a motion, * and #, gn, the global command :g, ranges, buffers, windows and splits.

None of this is a criticism: a 30-minute tutorial has to stop somewhere. It is just worth knowing that "I did vimtutor" means you have the alphabet, not the grammar.

Try it here

The dot command, which vimtutor skips

Tick off the list. Put an x in the first box with rx (replace one character), then go down with j and press .: Vim repeats the replace. One change typed once, repeated with a single key.

1 of 3Move onto the space inside the first box and press rx
1- [ ] milk
1- [ ] eggs
2- [ ] bread
NORMALLoading the editor…1/30.0s1:1

This editor needs a keyboard. Read on, and play it at your computer.

What to do after vimtutor

  • Use Vim for one real task a day, even a small one: a commit message, a config file, a note. Keep the Vim cheat sheet open next to it.
  • Learn the dot command next. Change one word with cw, move with n, press .. It changes how you think about edits. The dot command lesson is free and takes a few minutes.
  • Then text objects (ciw, ci", dap): they let you edit things by what they are rather than by counting characters.
  • Read on when you are ready for depth: the Vim user manual (:help user-manual) picks up where vimtutor leaves off, and a book like "Practical Vim" is the classic next step.

For a longer plan, with every option ranked by what it is best for, see the best way to learn Vim.

Interactive alternatives

Vimtutor's main weakness is that it never tells you whether you got an exercise right (Neovim's version does, with its check marks). Several browser courses fill that gap, each with its own trade-offs:

  • VimNinja (this site): 82 lessons in 14 tracks on its own Vim engine, checked against Neovim. The first 13 lessons (Foundations and The Vim Way) are free without sign-up. It covers the dot command, text objects, registers and macros that vimtutor leaves out; the rest of the course is a one-time $49.
  • vim-hero: interactive lessons in the browser, the first 12 free without an account.
  • OpenVim: a free, short interactive tutorial and a sandbox.
  • Vim Adventures: a game that teaches motions as you play; paid after the opening levels.

All of these run in a simulated editor. Vimtutor runs in Vim itself, which is why it is still worth doing first, whichever you pick next.

Questions

Is vimtutor free?
Yes. It ships with Vim on every platform, and Neovim includes the same tutorial as :Tutor. There is nothing to buy or sign up for.
How do I run vimtutor on Windows?
Install Vim with the official installer, then open Vimtutor from the Vim entry in the Start menu, or run vimtutor.bat from the Vim installation folder.
How do I start chapter two?
Run vimtutor -c 2. It takes 8 to 10 minutes and covers text objects, registers and marks. In Neovim, follow the link at the end of :Tutor.
Is vimtutor enough to learn Vim?
It is enough to edit a file without getting stuck. It is not enough to be fast: the dot command, text objects, search motions and macros come after it.

Sources