From 3588369ad527589c8031fe3f5fb719b57f9500ad Mon Sep 17 00:00:00 2001 From: Delapouite Date: Tue, 7 Nov 2017 08:29:08 +0100 Subject: [PATCH] Docs: group commands in common sections --- doc/pages/commands.asciidoc | 104 +++++++++++++++++++----------------- 1 file changed, 56 insertions(+), 48 deletions(-) diff --git a/doc/pages/commands.asciidoc b/doc/pages/commands.asciidoc index 4f9bc851..46cf5c2b 100644 --- a/doc/pages/commands.asciidoc +++ b/doc/pages/commands.asciidoc @@ -1,21 +1,21 @@ = Commands -== Builtins - 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). Aliases are mentionned below each commands. -*change-directory* []:: - *alias* cd + - change the current directory to *directory*, or the home directory if - unspecified - *doc* :: *alias* help + display documentation about a topic. The completion list displays the available topics +== Files and Buffers + +*change-directory* []:: + *alias* cd + + change the current directory to *directory*, or the home directory if + unspecified + *edit[!]* [ []]:: *alias* e + open buffer on file, go to given line and column. If file is already @@ -43,9 +43,6 @@ command *q!* has to be used). Aliases are mentionned below each commands. write all buffers and quit. If specified, the client exit status will be set to -*kill[!]*:: - terminate the current session, all the clients as well as the server - *buffer* :: *alias* b + switch to buffer @@ -62,37 +59,25 @@ command *q!* has to be used). Aliases are mentionned below each commands. *alias* db + delete the buffer +*rename-buffer* :: + set current buffer name + *source* :: execute commands in -*colorscheme* :: - load named colorscheme +== Clients and Sessions *rename-client* :: *alias* nc + set current client name -*rename-buffer* :: - set current buffer name - *rename-session* :: set current session name -*echo* [options] :: - show *text* in status line, with the following *options*: +*kill[!]*:: + terminate the current session, all the clients as well as the server - *-markup*::: - expand the markup strings in *text* (See - <>) - - *-debug*::: - print the given text to the *\*debug** buffer - -*nop*:: - does nothing, but arguments will be evaluated (e.g. shell expansion) - -*fail* :: - raise an error, uses as its description +== Options *declare-option* [-hidden] []:: *alias* decl + @@ -116,6 +101,12 @@ command *q!* has to be used). Aliases are mentionned below each commands. update the value of an option if its type supports that operation (See <>) +== Commands and Keys + +*define-command* [] :: + *alias* def + + define a new command (See <>) + *alias* :: define a new alias, within the context of a scope @@ -123,22 +114,14 @@ command *q!* has to be used). Aliases are mentionned below each commands. remove an alias if its current value is the same as the one passed as an optional parameter, remove it unconditionally otherwise -*set-face* :: - *alias* face + - define a face (See <>) - -*execute-keys* [] ...:: - *alias* exec + - execute a series of keys, as if they were hit (See <>) - *evaluate-commands* [] ...:: *alias* eval + evaluate commands, as if they were entered in the command prompt (See <>) -*define-command* [] :: - *alias* def + - define a new command (See <>) +*execute-keys* [] ...:: + *alias* exec + + execute a series of keys, as if they were hit (See <>) *map* :: bind a list of keys to a combination (See <>) @@ -146,6 +129,8 @@ command *q!* has to be used). Aliases are mentionned below each commands. *unmap* []:: unbind a key combination (See <>) +== Hooks + *hook* [-group ] :: execute a command whenever an event is triggered (See <>) @@ -155,6 +140,25 @@ command *q!* has to be used). Aliases are mentionned below each commands. remove every hooks in *scope* that are part of the given *group* (See <>) +== Display + +*echo* [options] :: + show *text* in status line, with the following *options*: + + *-markup*::: + expand the markup strings in *text* (See + <>) + + *-debug*::: + print the given text to the *\*debug** buffer + +*set-face* :: + *alias* face + + define a face (See <>) + +*colorscheme* :: + load named colorscheme + *add-highlighter* [] ...:: *alias* addhl + add a highlighter to the current window @@ -168,7 +172,8 @@ command *q!* has to be used). Aliases are mentionned below each commands. == Helpers Kakoune provides some helper commands that can be used to define composite -commands: +commands in scripts. They are also available in the interactive mode, +but not really useful in that context. *prompt* :: prompt the user for a string, when the user validates, executes the @@ -179,9 +184,9 @@ commands: *-password* switch hides the entered text and clears the register after command execution. - The *-on-change* and *-on-abort* switches, followed by a command - will have this command executed whenever the prompt content changes - or the prompt is aborted, respectively. + The *-on-change* and *-on-abort* switches, followed by a command + will have this command executed whenever the prompt content changes + or the prompt is aborted, respectively. *on-key* :: wait for next key from user, then execute , the key is @@ -213,9 +218,15 @@ commands: execution, execute *on_error_commands* instead. If nothing is to be done on error, the catch part can be omitted +*nop*:: + does nothing, but arguments will be evaluated (e.g. shell expansion) + +*fail* :: + raise an error, uses as its description + *set-register* :: *alias* reg + - set register *name* to *content* + set register *name* to *content* (See <>) *select* .,.:...:: replace the current selections with the one described in the argument @@ -223,9 +234,6 @@ commands: *debug* {info,buffers,options,memory,shared-strings,profile-hash-maps,faces,mappings}:: print some debug information in the *\*debug** buffer -Note that those commands are also available in the interactive mode, but -are not really useful in that context. - == Multiple commands Commands (c.f. previous sections) can be chained, by being separated either