From a0bcdd83df6d279f22042915266b53e70e80c140 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 10 Nov 2015 20:30:27 +0000 Subject: [PATCH] Document default registers --- README.asciidoc | 10 ++++++++++ src/input_handler.cc | 7 ++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/README.asciidoc b/README.asciidoc index f63635a5..92e1e951 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -851,6 +851,16 @@ contain some special data: * `.`: current selection contents * `#`: selection indices (first selection has 1, second has 2, ...) +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` + Macros ~~~~~~ diff --git a/src/input_handler.cc b/src/input_handler.cc index 6b35fcc5..2cb1f379 100644 --- a/src/input_handler.cc +++ b/src/input_handler.cc @@ -149,7 +149,12 @@ constexpr StringView register_doc = "Special registers:\n" " * %: buffer name\n" " * .: selection contents\n" - " * #: selection index\n"; + " * #: selection index\n" + " * [0-9]: selections capture group\n" + " * \": default yank/paste register\n" + " * @: default macro register\n" + " * /: default search register\n" + " * ^: default mark register\n"; class Normal : public InputMode {