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

View File

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

View File

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