Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Migrating from Vim

Mitos uses selection-first editing: select the text, then apply an action. For example, Vim’s dw becomes wd. A cursor is a one-character selection. See Basics for a walkthrough or run ms --tutor.

Delete/Change Commands

TaskVimMitos
Delete a worddwwd
Change a wordcwec, or wc including following whitespace
Delete a characterxd; use ;d to collapse an existing selection first
Copy a lineyyxy
Replace throughout a file:%s/word/replacement/g%, s, type word, Enter, Alt-r, type the replacement, Enter

Replacement text is literal; $1 does not expand a regex capture. See Search and replacement for selection and project searches.

TaskVimMitos
First / last linegg / Ggg / ge
Line start / end0 / $gh / gl
First nonblank character^gs
Matching bracket%mm
Alternate fileCtrl-^ga

Unlike Vim, f, F, t, and T can search across line boundaries. Mitos’s gw displays labels at words: type a label to jump to that word.

Line Deletes

TaskVimMitos
Delete to line endDvgld
Delete a whole lineddxd

v extends the selection as you move; x selects the current line.

TaskMitos
Completion while insertingCtrl-x
Toggle commentsSpace c
Search for a wordmiw, *, then n
Add a cursor belowC
Keep only one selection,

For a rectangular edit, add cursors with C and extend the selections using normal motions. See Selections and Completion and snippets.

File actions

Use Space f for files and Space b for open buffers. Ctrl-w opens the window menu; see Files, buffers, and splits.

:reload reads the current file from disk and discards unsaved edits. :sh <command> runs a shell command; ! inserts command output. See Shell commands.

Mitos uses the jumplist for saved locations: Ctrl-s saves one, Ctrl-o goes back, Ctrl-i goes forward, and Space j opens the list.

See Textobjects, Surround, and Registers for other familiar operations with different keys.

The cursor is a block in every mode by default. To use a bar while inserting:

[editor.cursor.shape]
insert = "bar"