From 2244a5d40c83d477839f91cb6d6a4aeb02446a97 Mon Sep 17 00:00:00 2001 From: omentic Date: Wed, 1 May 2024 23:29:52 +0000 Subject: deploy: 12eec890240a05d1e090114f7f4fdd7c1ee8ff88 --- usage.html | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'usage.html') diff --git a/usage.html b/usage.html index 1da055cb..d95e5993 100644 --- a/usage.html +++ b/usage.html @@ -204,19 +204,19 @@ can be accessed via the command hx --tutor or :tutor.<

Registers

In Helix, registers are storage locations for text and other data, such as the result of a search. Registers can be used to cut, copy, and paste text, similar -to the clipboard in other text editors. Usage is similar to Vim, with " being +to the clipboard in other text editors. Usage is similar to Vim, with " being used to select a register.

User-defined registers

Helix allows you to create your own named registers for storing text, for example:

If a register is selected before invoking a change or delete command, the selection will be stored in the register and the action will be carried out:

Default registers

Commands that use registers, like yank (y), use a default register if none is specified. @@ -224,7 +224,7 @@ These registers are used as defaults:

- +
Register characterContains
/Last search
:Last executed command
"Last yanked text
"Last yanked text
@Last recorded macro
@@ -235,8 +235,8 @@ These registers are used as defaults:

#Selection indices (first selection is 1, second is 2, etc.)This register is not writable .Contents of the current selectionsThis register is not writable %Name of the current fileThis register is not writable -*Reads from the system clipboardJoins and yanks to the system clipboard -+Reads from the primary clipboardJoins and yanks to the primary clipboard ++Reads from the system clipboardJoins and yanks to the system clipboard +*Reads from the primary clipboardJoins and yanks to the primary clipboard

When yanking multiple selections to the clipboard registers, the selections @@ -306,7 +306,7 @@ documentation.

and requires the corresponding query file to work properly.

Moving the selection with syntax-aware motions

-

Alt-p, Alt-o, Alt-i, and Alt-n (or Alt and arrow keys) allow you to move the +

Alt-p, Alt-o, Alt-i, and Alt-n (or Alt and arrow keys) allow you to move the selection according to its location in the syntax tree. For example, many languages have the following syntax for function calls:

func(arg1, arg2, arg3);
@@ -328,12 +328,12 @@ a more intuitive tree format:

│ │ ┌─────▼────┐ ┌────▼────┐ │identifier│ │arguments│ -│ "func" │ ┌────┴───┬─────┴───┐ +│ "func" │ ┌────┴───┬─────┴───┐ └──────────┘ │ │ │ │ │ │ ┌─────────▼┐ ┌────▼─────┐ ┌▼─────────┐ │identifier│ │identifier│ │identifier│ - │ "arg1" │ │ "arg2" │ │ "arg3" │ + │ "arg1" │ │ "arg2" │ │ "arg3" │ └──────────┘ └──────────┘ └──────────┘

If you have a selection that wraps arg1 (see the tree above), and you use @@ -352,7 +352,7 @@ node with no sibling. When using Alt-p with a selection on ar child node will be selected. In the event that arg1 does not have a previous sibling, the selection will move up the syntax tree and select the previous element. As a result, using Alt-p with a selection on arg1 will move the -selection to the "func" identifier.

+selection to the "func" identifier.

-- cgit v1.2.3-70-g09d2