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

Editing effectively

These articles build on Basics to help you use Mitos for everyday work. Start by selecting the text you want to change, learn to repeat that edit, then use those skills while exploring and reviewing a project.

Follow the articles in order, or choose the one that fits your current task:

ArticleWhat you will practice
1. Edit code with textobjectsNavigate functions and siblings, expand to parent expressions, and edit related structures together
2. Repeat and combine editsReview matches, edit many selections, filter lines, and choose when to use a macro
3. Navigate a projectFind files and symbols, follow code, compare files in splits, and return to your edit
4. Review and stage changesReview unsaved edits, stage the intended file version, and use Git history

The exercises use the default bindings. As in Basics, miw means press m, then i, then w; Ctrl-o means press both keys together. Type each exercise and compare your result with the example before trying it on your own files.

Recover, then keep practicing

Before editing, check both the selected text and the number of selections. Esc leaves select or insert mode; it does not remove extra selections. Press , to keep one selection and ; to collapse it to its cursor.

If you select the wrong text, use Alt-u to restore the previous selections before making an edit. If you change the wrong text, use u to undo the edit. Editing text clears selection history. See Undo selection changes for the distinction.

Pick one exercise, try it on different text, and use it in your next small editing task. When a task feels repetitive, revisit Repeat and combine edits for another approach. Keep the default bindings while learning; add a custom binding when you know which repeated task it will help.

Further reading

Learn Vim the Smart Way by Igor Irianto and Practical Vim by Drew Neil offer more ideas for practicing modal editing and reducing repetitive work. Their examples use Vim commands; use the Mitos workflows on this page and Migrating from Vim to apply those ideas here.