kakoune/doc/pages/registers.asciidoc

76 lines
1.9 KiB
Plaintext
Raw Normal View History

= Registers
== Description
2016-02-10 22:03:49 +01:00
Registers are named lists of text -instead of simply text- in order to interact
2017-05-11 20:42:09 +02:00
well with multiselection. They are used for various purposes, like storing
the last yanked text, or the captured groups associated with the selections.
== Interacting
*<c-r><c>*::
2017-11-02 10:37:39 +01:00
when in insert mode or in a prompt, insert the value stored in the
*c* register (single character)
*"<c>*::
2017-11-02 10:37:39 +01:00
in normal mode, select the *<c>* register (single character)
== Alternate names
Non alphanumeric registers have an alternative name that can be used
in contexts where only alphanumeric identifiers are possible.
== Default registers
Most commands using a register default to a specific one if not specified:
*"* (dquote)::
2017-11-02 10:37:39 +01:00
default copy register, used by yanking and pasting commands like *y*, *p*
and *R*
*/* (slash)::
2017-11-02 10:37:39 +01:00
default search register, used by regex based commands like *s*, ***
or */*
*@* (arobase)::
2017-11-02 10:37:39 +01:00
default macro register, used by *q* and *Q*
*^* (caret)::
2017-11-02 10:37:39 +01:00
default mark register, used by *z* and *Z*
*|* (pipe)::
2017-11-02 10:37:39 +01:00
default shell command register, used by command that spawn a subshell such as
*|*, *<a-|>*, *!* or *<a-!>*
== Special registers
2016-02-10 22:03:49 +01:00
Some registers are not general purposes, they cannot be written to, but they
contain some special data
*%* (percent)::
2017-11-02 10:37:39 +01:00
current buffer name
*.* (dot)::
2017-11-02 10:37:39 +01:00
current selection contents
*#* (hash)::
2017-11-02 10:37:39 +01:00
selection indices (first selection has 1, second has 2, ...)
*_* (underscore)::
2017-11-02 10:37:39 +01:00
null register, always empty
2016-03-31 10:19:33 +02:00
*:* (colon)::
2017-11-02 10:37:39 +01:00
last entered command
== Integer registers
Registers *1* to *9* hold the grouped sub-matches of the regular
expression used to make the last selection. Example: applying the
following regular expression to the date of the day would put the day of
the week in register *1*, the month in register *2*, and the day of the
month in register *3*, but select the entire date:
--------------------
(\w+) (\w+) (\d+) .+
--------------------