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

暫存器

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 used to select a register.

使用者定義的暫存器

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

  • "ay - Yank the current selection to register a.
  • "op - Paste the text in register o after the selection.

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:

  • "hc - Store the selection in register h and then change it (delete and enter insert mode).
  • "md - Store the selection in register m and delete it.

預設暫存器

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

暫存器字元Contains
/最後一次搜尋
:最後一次執行的命令
"Last yanked text
@最後一次錄製的巨集

特殊暫存器

Some registers have special behavior when read from and written to.

暫存器字元When readWhen written
_No values are returnedAll values are discarded
#Selection indices (first selection is 1, second is 2, etc.)This register is not writable
.Contents of the current selectionsThis register is not writable
%當前檔案的名稱This register is not writable
+從系統剪貼簿讀出Joins and yanks to the system clipboard
*從主要剪貼簿讀出Joins and yanks to the primary clipboard

When yanking multiple selections to the clipboard registers, the selections are joined with newlines. Pasting from these registers will paste multiple selections if the clipboard was last yanked to by the Helix session. Otherwise the clipboard contents are pasted as one selection.