From de6700c742a362b144f02f8bef48aed06849ef21 Mon Sep 17 00:00:00 2001 From: David Crespo Date: Wed, 31 Jul 2024 17:04:11 -0500 Subject: [PATCH] add key concepts to usage.md --- book/src/usage.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/book/src/usage.md b/book/src/usage.md index 859cb670959d9..32520fe9a7d26 100644 --- a/book/src/usage.md +++ b/book/src/usage.md @@ -7,3 +7,27 @@ can be accessed via the command `hx --tutor` or `:tutor`. > 💡 Currently, not all functionality is fully documented, please refer to the > [key mappings](./keymap.md) list. +## Modes + +Helix is a modal editor, meaning it has different modes for different tasks. The main modes are: + +* [Normal mode](./keymap.md#normal-mode): For navigation and editing commands. This is the default mode. +* [Insert mode](./keymap.md#insert-mode): For typing text directly into the document. Access by typing `i` in normal mode. +* [Select/extend mode](./keymap.md#select--extend-mode): For making selections and performing operations on them. Access by typing `v` in normal mode. + +## Buffers + +Buffers are in-memory representations of files. You can have multiple buffers open at once, allowing you to work on several files without closing them. Use pickers (see below) to switch between open buffers or commands like `:buffer-next` and `:buffer-previous`. + +## Selection-first editing + +Inspired by [Kakoune](http:// kakoune.org/), Helix follows the `selection → action` model. This means that whatever you are going to act on (a word, a paragraph, a line, etc.) is selected first and the action itself (delete, change, yank, etc.) comes second. A cursor is simply a single width selection. + +## Multiple selections + +Also inspired by Kakoune, multiple selections are a core mode of interaction in Helix. For example, the standard way of replacing multiple instance of a word is to first select all instances (so there is one selection per instance) and then use the change action (`c`) to edit them all at the same time. + +## Motions + +Motions are commands that move the cursor or modify selections. They're used for navigation and text manipulation. Examples include `w` to move to the next word, or `f` to find a character. See the [Movement](./keymap.md#movement) section of the keymap for more motions. +