Documentation fixes and updates (#933)

- Document history option
- Use $() command substitution syntax because backticks are replaced
  with quotes in gen/docstring.sh
- Movement commands no longer close the search prompt (85aa3b9)
- Use the -L flag of the file command instead of readlink
This commit is contained in:
Paul Ouellette authored and GitHub committed 2022-10-01 16:29:21 +03:00
1 parent 01d3b69de0
commit 5ba70d0f61
4 files changed
+46 -47

No files matched your search

+14 -15
View File
@@ -630,6 +630,10 @@ Patterns can be given as relative or absolute paths.
Globbing supports the usual special characters, '*' to match any sequence, '?' to match any character, and '[...]' or '[^...] to match character sets or ranges.
In addition, if a pattern starts with '!', then its matches are excluded from hidden files.
history bool (default on)
Save command history.
icons bool (default off)
Show icons before each item in the list.
@@ -863,7 +867,7 @@ This shell command can be defined to override the default 'paste' command.
rename
This shell command can be defined to override the default 'paste' command.
This shell command can be defined to override the default 'rename' command.
delete
@@ -1048,7 +1052,7 @@ A first attempt to write such a command may look like this:
if [ -z "$fs" ]; then
mv "$f" ~/.trash
else
IFS="`printf '\n\t'`"; mv $fs ~/.trash
IFS="$(printf '\n\t')"; mv $fs ~/.trash
fi
}}
@@ -1059,7 +1063,7 @@ We can use this variable to get rid of the conditional:
cmd trash ${{
mkdir -p ~/.trash
IFS="`printf '\n\t'`"; mv $fx ~/.trash
IFS="$(printf '\n\t')"; mv $fx ~/.trash
}}
The trash directory is checked each time the command is executed.
@@ -1067,13 +1071,13 @@ We can move it outside of the command so it would only run once at startup:
${{ mkdir -p ~/.trash }}
cmd trash ${{ IFS="`printf '\n\t'`"; mv $fx ~/.trash }}
cmd trash ${{ IFS="$(printf '\n\t')"; mv $fx ~/.trash }}
Since these are one liners, we can drop '{{' and '}}':
$mkdir -p ~/.trash
cmd trash $IFS="`printf '\n\t'`"; mv $fx ~/.trash
cmd trash $IFS="$(printf '\n\t')"; mv $fx ~/.trash
Finally note that we set 'IFS' variable manually in these commands.
Instead we could use the 'ifs' option to set it for all shell commands (i.e. 'set ifs "\n"').
@@ -1219,14 +1223,10 @@ You can enable 'globsearch' option to match with a glob pattern.
Globbing supports '*' to match any sequence, '?' to match any character, and '[...]' or '[^...] to match character sets or ranges.
You can enable 'incsearch' option to jump to the current match at each keystroke while typing.
In this mode, you can either use 'cmd-enter' to accept the search or use 'cmd-escape' to cancel the search.
Alternatively, you can also map some other commands with 'cmap' to accept the search and execute the command immediately afterwards.
Possible candidates are 'up', 'down' and their variants, 'top', 'bottom', 'updir', and 'open' commands.
For example, you can use arrow keys to finish the search with the following mappings:
You can also map some other commands with 'cmap' to accept the search and execute the command immediately afterwards.
For example, you can use the right arrow key to finish the search and open the selected file with the following mapping:
cmap <up> up
cmap <down> down
cmap <left> updir
cmap <right> open
cmap <right> :cmd-enter; open
Finding mechanism is implemented with commands 'find' (default 'f'), 'find-back' (default 'F'), 'find-next' (default ';'), 'find-prev' (default ',').
You can disable 'anchorfind' option to match a pattern at an arbitrary position in the filename instead of the beginning.
@@ -1256,8 +1256,7 @@ It is possible to use different command types:
You may want to use either file extensions or mime types from 'file' command:
cmd open ${{
test -L $f && f=$(readlink -f $f)
case $(file --mime-type $f -b) in
case $(file --mime-type -Lb $f) in
text/*) vi $fx;;
*) for f in $fx; do xdg-open $f > /dev/null 2> /dev/null & done;;
esac
@@ -1276,7 +1275,7 @@ Previewing Files
lf previews files on the preview pane by printing the file until the end or the preview pane is filled.
This output can be enhanced by providing a custom preview script for filtering.
This can be used to highlight source codes, list contents of archive files or view pdf or image files to name few.
This can be used to highlight source codes, list contents of archive files or view pdf or image files to name a few.
For coloring lf recognizes ansi escape codes.
In order to use this feature you need to set the value of 'previewer' option to the path of an executable file.