From d305015b7710ef40f00ebe778343f5ee20fd94e6 Mon Sep 17 00:00:00 2001 From: Ilya Grigoriev Date: Sat, 15 Oct 2022 17:58:32 -0700 Subject: [PATCH] Document mode-switching between `:` and `!/$/%/&` command-line modes Documents #960, also known as https://github.com/gokcehan/lf/pull/960/commits/52a151aba22f745e045427bf6c45511325abc6fa --- doc.go | 15 ++++++++++++--- docstring.go | 20 +++++++++++++++----- lf.1 | 13 +++++++++++-- 3 files changed, 38 insertions(+), 10 deletions(-) diff --git a/doc.go b/doc.go index e78d41f3..6bdbd102 100644 --- a/doc.go +++ b/doc.go @@ -479,8 +479,13 @@ Tag a file with '*' or a single width character given in the argument if the fil # Command Line Commands -This section shows information about command line commands. -These should be mostly compatible with readline keybindings. +The prompt character specifies which of the several command-line modes you are in. +For example, the 'read' command takes you to the ':' mode. + +When the cursor is at the first character in ':' mode, pressing one of the keys '!', '$', '%', or '&' takes you to the corresponding mode. +You can go back with 'cmd-delete-back' ('' by default). + +The command line commands should be mostly compatible with readline keybindings. A character refers to a unicode code point, a word consists of letters and digits, and a unix word consists of any non-blank characters. cmd-escape (default '') @@ -526,9 +531,13 @@ Move the cursor to the left/right. Move the cursor to the beginning/end of line. cmd-delete (default '' and '') + +Delete the next character. + cmd-delete-back (default '' and '') -Delete the next character in forward/backward direction. +Delete the previous character. +When at the beginning of a prompt, returns either to normal mode or to ':' mode. cmd-delete-home (default '') cmd-delete-end (default '') diff --git a/docstring.go b/docstring.go index 9579d64c..5148b297 100644 --- a/docstring.go +++ b/docstring.go @@ -499,10 +499,16 @@ file is untagged, otherwise remove the tag. # Command Line Commands -This section shows information about command line commands. These should be -mostly compatible with readline keybindings. A character refers to a unicode -code point, a word consists of letters and digits, and a unix word consists of -any non-blank characters. +The prompt character specifies which of the several command-line modes you are +in. For example, the 'read' command takes you to the ':' mode. + +When the cursor is at the first character in ':' mode, pressing one of the keys +'!', '$', '%', or '&' takes you to the corresponding mode. You can go back with +'cmd-delete-back' ('' by default). + +The command line commands should be mostly compatible with readline keybindings. +A character refers to a unicode code point, a word consists of letters and +digits, and a unix word consists of any non-blank characters. cmd-escape (default '') @@ -548,9 +554,13 @@ Move the cursor to the left/right. Move the cursor to the beginning/end of line. cmd-delete (default '' and '') + +Delete the next character. + cmd-delete-back (default '' and '') -Delete the next character in forward/backward direction. +Delete the previous character. When at the beginning of a prompt, returns either +to normal mode or to ':' mode. cmd-delete-home (default '') cmd-delete-end (default '') diff --git a/lf.1 b/lf.1 index 37f91052..7a4ac42b 100644 --- a/lf.1 +++ b/lf.1 @@ -585,7 +585,11 @@ Tag a file with '*' or a single width character given in the argument. You can d .PP Tag a file with '*' or a single width character given in the argument if the file is untagged, otherwise remove the tag. .SH COMMAND LINE COMMANDS -This section shows information about command line commands. These should be mostly compatible with readline keybindings. A character refers to a unicode code point, a word consists of letters and digits, and a unix word consists of any non-blank characters. +The prompt character specifies which of the several command-line modes you are in. For example, the 'read' command takes you to the ':' mode. +.PP +When the cursor is at the first character in ':' mode, pressing one of the keys '!', '$', '%', or '&' takes you to the corresponding mode. You can go back with 'cmd-delete-back' ('' by default). +.PP +The command line commands should be mostly compatible with readline keybindings. A character refers to a unicode code point, a word consists of letters and digits, and a unix word consists of any non-blank characters. .PP .EX cmd-escape (default '') @@ -647,10 +651,15 @@ Move the cursor to the beginning/end of line. .PP .EX cmd-delete (default '' and '') +.EE +.PP +Delete the next character. +.PP +.EX cmd-delete-back (default '' and '') .EE .PP -Delete the next character in forward/backward direction. +Delete the previous character. When at the beginning of a prompt, returns either to normal mode or to ':' mode. .PP .EX cmd-delete-home (default '')