From 929c209c01946c69fac4c5cfe457a55cbae19698 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sun, 15 Nov 2015 13:25:02 +0000 Subject: [PATCH] Document keys recognized in insert and prompt mode --- README.asciidoc | 76 +++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 64 insertions(+), 12 deletions(-) diff --git a/README.asciidoc b/README.asciidoc index 92e1e951..d50307cb 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -215,9 +215,30 @@ Insert Mode ~~~~~~~~~~~ When entering insert mode, keys are now directly inserted before each selections -cursor. A few additional keys are supported, like arrow keys to move around, however -their use is not encouraged. You can go back to normal mode by pressing the `` -key. +cursor. Some additional keys are recognized in insert mode: + + * ``: leave insert mode + * ``: delete characters before cursors + * ``: delete characters under cursors + * `, , , `: move the cursors in given direction + * ``: move cursors to line begin + * ``: move cursors to end of line + + * ``: select next completion candidate + * ``: select previous completion candidate + * ``: explicit insert completion query, followed by: + - `f`: explicit file completion + - `w`: explicit word completion + - `l`: explicit line completion + * ``: disable automatic completion for this insert session + + * ``: insert contents of the register given by next key + * ``: insert next keystroke directly into the buffer, + without interpretting it. + + * ``: commit changes up to now as a single undo group. + + * ``: escape to normal mode for a single command Movement ~~~~~~~~ @@ -486,9 +507,41 @@ Commands 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. You can cycle through the command history with -`` and ``. Commands starting with horizontal whitespace (e.g. a -space) will not be saved in the command history. +current one, quitting, etc. + +A few keys are recognized by prompt mode to help editing 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 to passed last character + * ` or `: erase character before cursor + * ` or `: erase character under cursor + + * ``: avance 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 interpretting it + + * ``: disable auto completion for this prompt + + +Commands starting with horizontal whitespace (e.g. a space) will not be +saved in the command history. Basic Commands ~~~~~~~~~~~~~~ @@ -526,7 +579,7 @@ When entering a command, parameters are separated by whitespace (shell like), if you want to give parameters with spaces, you should quote them. Kakoune support three string syntax: - + * `'strings'`: uninterpreted strings, you can use `\'` to escape the separator, every other char is itself. @@ -721,7 +774,7 @@ Some options are built in Kakoune, and can be used to control it's behaviour: as candidates on filename completion (except if the text being completed already matches it). * `disabled_hooks` _regex_: hooks whose group matches this regex wont be - executed. For example indentation hooks can be disabled with '.*-indent'. + executed. For example indentation hooks can be disabled with '.*-indent'. * `filetype` _str_: arbitrary string defining the type of the file filetype dependant actions should hook on this option changing for activation/deactivation. @@ -929,7 +982,6 @@ using *control-x*, followed, by: * *f* : filename completion * *w* : buffer word completion * *l* : buffer line completion - * *o* : option based completion Completion candidates can be selected using `ctrl-n` and `ctrl-p`. @@ -1198,9 +1250,9 @@ Key Mapping You can redefine a key's meaning using the map command ------------------------------------------------------- +-------------------------------- :map ------------------------------------------------------- +-------------------------------- with `scope` being one of `global`, `buffer` or `window` (or any prefix), mode being `insert`, `normal`, `prompt`, `menu` or `user` (or any prefix), `key` being @@ -1245,7 +1297,7 @@ Some helper commands can be used to define composite commands: * `:prompt `: Prompt the user for a string, when the user validates, store the result in given and run . - the -init switch allows setting initial content. + the -init switch allows setting initial content. * `:onkey `: Wait for next key from user, writes it into given and execute commands. * `:menu ...`: display a menu using