From 3c17aa32b54614edac977dfc32bd7de8754b516b Mon Sep 17 00:00:00 2001 From: Delapouite Date: Fri, 10 Nov 2017 18:06:38 +0100 Subject: [PATCH] Docs: add README links to marks, jumps, objects, macros and macros keys --- README.asciidoc | 105 +++++----------------------------------- doc/pages/keys.asciidoc | 43 ++++++++++------ 2 files changed, 40 insertions(+), 108 deletions(-) diff --git a/README.asciidoc b/README.asciidoc index dbcd7982..f0672ff7 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -510,30 +510,16 @@ Marks ~~~~~ Current selections position can be saved in a register and restored later on. -By default, marks use the '^' register, but using the register can be set -using `"` prefix. -`Z` will save the current selections to the register. -`` will combine the current selections to the register. -`z` will restore the selections from the register. -`` will combine the selections from the register with the existing ones. - -When combining selections, kakoune will prompt for a combining mode: - -`+` will append selections from both lists into a single list -`<` will select the selection with the leftmost cursor for each pair -`>` will select the selection with the rightmost cursor for each pair +See <>. Jump list ~~~~~~~~~ Some commands, like the goto commands, buffer switch or search commands, -push the previous selections to the client's jump list. It is possible -to forward or backward in the jump list using: +push the previous selections to the client's jump list. - * ``: Jump forward - * ``: Jump backward - * ``: save current selections +See <>. Multi Selection ~~~~~~~~~~~~~~~ @@ -579,40 +565,10 @@ Selections whose shell command returns 0 will be kept, other will be dropped. Object Selection ~~~~~~~~~~~~~~~~ -Some keys allow you to select a text object: +Objects are specific portions of text, like sentences, paragraphs, numbers… +Kakoune offers many keys allowing you to select various text objects. - * ``: selects the whole object - * ``: selects the inner object, that is the object excluding its surrounder. - For example, for a quoted string, this will not select the quote, and - for a word this will not select trailing spaces. - * `[`: selects to object start - * `]`: selects to object end - * `{`: extends selections to object start - * `}`: extends selections to object end - -After this key, you need to enter a second key in order to specify which -object you want. - - * `b`, `(` or `)`: select the enclosing parenthesis - * `B`, `{` or `}`: select the enclosing {} block - * `r`, `[` or `]`: select the enclosing [] block - * `a`, `<` or `>`: select the enclosing <> block - * `"` or `Q`: select the enclosing double quoted string - * `'` or `q`: select the enclosing single quoted string - * ``` or `g`: select the enclosing grave quoted string - * `w`: select the whole word - * `W`: select the whole WORD - * `s`: select the sentence - * `p`: select the paragraph - * `␣`: select the whitespaces - * `i`: select the current indentation block - * `n`: select the number - * `u`: select the argument - * `c`: select user defined object, will prompt - for open and close text. - -For nestable objects, a count can be used in order to specify which surrounding -level to select. +See <>. Commands -------- @@ -622,39 +578,7 @@ When pressing `:` in normal mode, Kakoune will open a prompt to enter a command. Commands are used for non editing tasks, such as opening a buffer, writing the current one, quitting, etc. -A few keys are recognized by prompt mode to help edit a command: - - * ``: validate prompt - * ``: abandon without - - * ` or `: move cursor to previous character - * ` or `: move cursor to previous character - * ``: move cursor to first character - * ``: move cursor past the last character - * ` or `: erase character before cursor - * ` or `: erase character under cursor - - * ``: advance to next word begin - * ``: advance to next WORD begin - * ``: go back to previous word begin - * ``: go back to previous WORD begin - * ``: advance to next word end - * ``: advance to next word end - - * ` or `: select previous entry in history - * ` or `: select next entry in history - - * ``: select next completion candidate - * ``: select previous completion candidate - - * ``: insert then content of the register given by next key. - * ``: insert next keystroke without interpreting it - - * ``: disable auto completion for this prompt - - -Commands starting with horizontal whitespace (e.g. a space) will not be -saved in the command history. +See <>. Basic Commands ~~~~~~~~~~~~~~ @@ -663,6 +587,9 @@ Some commands take an exclamation mark (`!`), which can be used to force the execution of the command (i.e. to quit a modified buffer, the command `q!` has to be used). +Commands starting with horizontal whitespace (e.g. a space) will not be +saved in the command history. + * `cd []`: change the current directory to ``, or the home directory if unspecified * `doc `: display documentation about a topic. The completion list displays the available topics. @@ -781,21 +708,13 @@ Macros Kakoune can record and replay a sequence of key presses. -Macros are recorded with the `Q` key, and are stored by default in the `@` -register. Another register can be chosen by with hitting `"` before -the `Q` key. - -To replay a macro, use the `q` key. +See <>. Search selection ~~~~~~~~~~~~~~~~ Using the `*` key, you can set the search pattern to the current selection. -This tries to be intelligent. It will for example detect if the current selection -begins and/or ends at word boundaries and set the search pattern accordingly. - -With `` you can set the search pattern to the current selection without -Kakoune trying to be smart. +See <>. Regex syntax ~~~~~~~~~~~~ diff --git a/doc/pages/keys.asciidoc b/doc/pages/keys.asciidoc index a6885403..c0c86312 100644 --- a/doc/pages/keys.asciidoc +++ b/doc/pages/keys.asciidoc @@ -357,7 +357,7 @@ is a sequence of non whitespace characters rotate (1, 2, 3) and (3, 4, 6) independently -== Goto Commands +== Goto commands *g*, *G*:: When a count is specified, *G* only extends the current selection to the given line, @@ -431,10 +431,10 @@ is a sequence of non whitespace characters *l*::: scroll the window count columns right - == Marks -Marks use the *^* register by default. +Current selections position can be saved in a register and restored later on. +Marks use the *^* register by default (See <>) *Z*:: save the current selections to the register @@ -470,10 +470,7 @@ Marks use the *^* register by default. == Macros -Macros use the *@* register by default - -**:: - end macro recording +Macros use the *@* register by default (See <>) *Q*:: start or end macro recording @@ -481,9 +478,12 @@ Macros use the *@* register by default *q*:: play a recorded macro +**:: + end macro recording + == Searching -Searches use the */* register by default +Searches use the */* register by default (See <>) ***:: set the search pattern to the current selection (automatically @@ -495,11 +495,15 @@ Searches use the */* register by default == Jump list +Some commands, like the goto commands, buffer switch or search commands, +push the previous selections to the client's jump list. It is possible +to skim through the jump list using: + **:: - Jump forward + jump forward **:: - Jump backward + jump backward **:: save current selections @@ -539,11 +543,16 @@ Searches use the */* register by default == Object Selection +For nestable objects, a count can be used in order to specify which surrounding +level to select. + **:: selects the whole object **:: - selects the inner object, that is the object excluding its surrounder + selects the inner object, that is the object excluding its surrounder. + For example, for a quoted string, this will not select the quote, and + for a word this will not select trailing spaces. *[*:: selects to object start @@ -572,13 +581,13 @@ object you want *a*, *<*, *>*:: select the enclosing <> block -*"*, *Q*:: +*Q*, *"*:: select the enclosing double quoted string -*'*, *q*:: +*q*, *'*:: select the enclosing single quoted string -*`*, *g*:: +*g*, *`*:: select the enclosing grave quoted string *w*:: @@ -608,7 +617,11 @@ object you want *c*:: select user defined object, will prompt for open and close text -== Prompt Commands +== Prompt commands + +When pressing `:` in normal mode, Kakoune will open a prompt to enter a command. +The following keys are recognized by this mode to help edition. +(See <>) **:: validate prompt