Tutor
This site is an editor, and it reads the way Vim does: by keys rather than by
scrolling. This lesson takes five minutes. Each step is ticked in the list
below as soon as you do it, in any order — and the list remembers, so you can
leave and come back.
Everything here works with the mouse or a finger too. The keys are just faster.
- Move down with
j, back up withkto do - Jump to the end with
G, back to the top withggto do - Search a word with
/, thennfor the next one to do - Number the lines from the cursor:
:set rnuto do - Give the tree the keys:
Spacewto do - Step into this list with
j: it is a block to do - Find a file by name:
Spaceffto do - Quit:
:q!to do
0 of 8 done
1. Move
The cursor is the bright block on the first line. j moves it down a line, k up.
h and l go left and right, w and b a word at a time. J and K move several lines
at once.
Press j a few times, then k.
2. Jump
G jumps to the last line of the page, gg back to the first. A number before
them goes to that line: 12G. So does :12 on the command line.
3. Search
/ opens a search at the bottom of the page. Type a word — try block — and
Enter. n goes to the next match, N to the previous one.
4. The command line
: opens the command line, at the bottom. It completes what you type with Tab,
and ↑ brings back what you typed before.
Commands set options. Try :set rnu: the line numbers now count from the cursor,
which is what 5j wants to know. :set nornu puts them back.
5. The tree
The pane on the left is a file tree: every page of the site is a file in it.
The leader key is Space, and it starts a few chords:
• Space e shows or hides the tree,
• Space w gives the keys to the tree, and back to the page.
In the tree, j and k move, Enter opens a file or folds a folder.
6. Blocks
Some lines are not text: a list of projects, a piano, the arcade — and the list
at the top of this page. They are blocks. Walk onto one with j and it takes the
keys: j and k move between its items, Enter opens one, Esc leaves it.
7. Find
Space f f finds a file by name, Space f g a word in every page. ? lists what
the pane you are in can do, at any time.
8. Quit
Every Vim lesson ends here. :q will not do it — the page has unsaved changes,
it says. :q! will.