Getting started¶
Install it¶
Or keep it around:
From a checkout:
The command line is small on purpose:
turbovi one.py two.py opens two buffers, :bn moves between them. turbovi notes.md +42 opens the file on line 42; without it, a file you have opened before opens where you left the cursor. turbovi on its own gives you a scratch buffer. turbovi . is the same as turbovi: a directory is not a file, so the buffer stays empty and the file picker starts there.
The one idea¶
vi has modes. It starts in normal mode, where the letter keys are commands. j moves down. dd deletes a line. To type text you enter insert mode, and to stop you press Esc.
The status bar tells you which mode you are in. When it says nothing, you are in normal mode.
Five minutes¶
Open a file and try these in order. Press Esc whenever you are unsure: it always returns you to normal mode.
| Do this | What happens |
|---|---|
j k h l |
down, up, left, right |
i then type, then Esc |
insert text before the cursor |
x |
delete the character under the cursor |
dd |
delete the line |
u |
undo it |
| Ctrl+R | redo it |
:w Enter |
write the file |
:q Enter |
quit |
:q! quits without writing. ZZ writes and quits.
Your terminal's own copy and paste work throughout (double-click a word, Cmd+C, Cmd+V) because TurboVI leaves the mouse to the terminal. A paste goes in as text, so you do not have to be in insert mode first.
The next five¶
Commands compose. An operator plus a motion is one command. Any motion works with any operator.
| Do this | What happens |
|---|---|
w b e |
forward a word, back a word, to the end of one |
dw |
delete a word: d is the operator, w the motion |
d2w |
delete two words |
2dw |
the same thing; the count can go either side |
ci" |
change what is inside the quotes the cursor is in |
yy then p |
copy this line, paste it below |
/thing Enter |
search forwards; n for the next hit |
. |
do that last change again |
Once dw, d2w and ci" each feel like one command, the rest of the key reference reads as a vocabulary to combine.
Where to go next¶
- Editing: the grammar in full: operators, motions, text objects, registers, undo,
., macros and marks. - Searching:
/and:sin this file, and Ctrl+G across the whole project. - Files and windows: several files at once, splits, the file picker, and what happens when the editor dies with unsaved work.
Settings. :set, the config file, and .editorconfig.
If your fingers already know vim, read differences from vim next: it lists every place they will get a different answer here.