Document register alternate names and add some missing ones

Fixes #853
This commit is contained in:
Maxime Coste 2016-10-09 21:32:36 +01:00
parent d89959dfa8
commit 314108e539
3 changed files with 36 additions and 20 deletions

View File

@ -1017,27 +1017,33 @@ selection.
Registers are lists, instead of simply text in order to interact well with
multiselection. Each selection has its own captures or yank buffer.
Alternate names
^^^^^^^^^^^^^^^
non alphanumeric registers have an alternative name that can be used
in contexts where only alphanumeric identifiers are possible.
Special registers
^^^^^^^^^^^^^^^^^
Some registers are not general purposes, they cannot be written to, but they
contain some special data:
* `%`: current buffer name
* `.`: current selection contents
* `#`: selection indices (first selection has 1, second has 2, ...)
* `_`: null register, always empty
* `%` (`percent`): current buffer name
* `.` (`dot`): current selection contents
* `#` (`dash`): selection indices (first selection has 1, second has 2, ...)
* `_` (`underscore`): null register, always empty
Default registers
^^^^^^^^^^^^^^^^^
Most commands using a register default to a specific one if not specified:
* `"`: default yank, used by yanking and pasting commands like `y`, `p` and `R`
* `/`: default search register, used by regex based commands like `s`, `*` or `/`
* `@`: default macro register, used by `q` and `Q`
* `^`: default mark register, used by `z` and `Z`
* `|`: default shell command register, used by command that spawn a subshell such as `|`, `<a-|>`, `!` or `<a-!>`
* `"` (`dqoute`): default yank register, used by yanking and pasting commands like `y`, `p` and `R`
* `/` (`slash`): default search register, used by regex based commands like `s`, `*` or `/`
* `@` (`arobase`): default macro register, used by `q` and `Q`
* `^` (`caret`): default mark register, used by `z` and `Z`
* `|` (`pipe`): default shell command register, used by command that spawn a subshell such as `|`, `<a-|>`, `!` or `<a-!>`
Macros
~~~~~~

View File

@ -20,25 +20,31 @@ Interacting
*"<c>*::
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:
*"*::
default yank, used by yanking and pasting commands like *y*, *p*
*"* (dquote)::
default yank register, used by yanking and pasting commands like *y*, *p*
and *R*
*/*::
*/* (slash)::
default search register, used by regex based commands like *s*, ***
or */*
*@*::
*@* (arobase)::
default macro register, used by *q* and *Q*
*^*::
*^* (caret)::
default mark register, used by *z* and *Z*
*|*::
*|* (pipe)::
default shell command register, used by command that spawn a subshell such as
*|*, *<a-|>*, *!* or *<a-!>*
@ -47,16 +53,16 @@ Special registers
Some registers are not general purposes, they cannot be written to, but they
contain some special data
*%*::
*%* (percent)::
current buffer name
*.*::
*.* (dot)::
current selection contents
*#*::
*#* (dash)::
selection indices (first selection has 1, second has 2, ...)
*_*::
*_* (underscore)::
null register, always empty
Integer registers

View File

@ -16,7 +16,11 @@ Register& RegisterManager::operator[](StringView reg) const
{ "dquote", '"' },
{ "pipe", '|' },
{ "caret", '^' },
{ "arobase", '@' }
{ "arobase", '@' },
{ "percent", '%' },
{ "dot", '.' },
{ "dash", '#' },
{ "underscore", '_' }
};
auto it = reg_names.find(reg);
if (it == reg_names.end())