From d81c84bbb92192ee7ec7568247347d0607b4def6 Mon Sep 17 00:00:00 2001 From: CatsDeservePets <145048791+CatsDeservePets@users.noreply.github.com> Date: Thu, 18 Sep 2025 19:39:15 +0200 Subject: [PATCH] Update docs (#2160) --- doc.md | 65 ++++++++++++++++++++++++++++++----- doc.txt | 105 +++++++++++++++++++++++++++++++++++++------------------- lf.1 | 102 ++++++++++++++++++++++++++++++++++-------------------- 3 files changed, 190 insertions(+), 82 deletions(-) diff --git a/doc.md b/doc.md index 738f62c1..15e06c1a 100644 --- a/doc.md +++ b/doc.md @@ -863,8 +863,19 @@ Jump to the first match after each keystroke during searching. ## info ([]string) (default ``) A list of information that is shown for directory items at the right side of the pane. -Currently supported information types are `size`, `time`, `atime`, `btime`, `ctime`, `perm`, `user`, `group` and `custom`. -The `custom` type is empty by default and can be updated using the `addcustominfo` command. + +The following information types are supported: + + perm file permission + user user name + group group name + size file size + time time of last data modification + atime time of last access + btime time of file birth + ctime time of last status (inode) change + custom property defined via `addcustominfo` (empty by default) + Information is only shown when the pane width is more than twice the width of information. ## infotimefmtnew (string) (default `Jan _2 15:04`) @@ -933,7 +944,17 @@ Preview filtering is disabled and files are displayed as they are when the value ## promptfmt (string) (default `\033[32;1m%u@%h\033[0m:\033[34;1m%d\033[0m\033[1m%f\033[0m`) Format string of the prompt shown in the top line. -Special expansions are provided, `%u` as the user name, `%h` as the hostname, `%w` as the working directory, `%d` as the working directory with a trailing path separator, `%f` as the filename, and `%F` as the current filter. `%S` may be used once and will provide a spacer so that the following parts are right-aligned on the screen. + +The following special expansions are supported: + + %f file name + %h host name + %u user name + %w working directory + %d working directory (with trailing path separator) + %F current filter + %S spacer to right-align the following parts (can be used once) + The home folder is shown as `~` in the working directory expansion. Directory names are automatically shortened to a single character starting from the leftmost parent when the prompt does not fit the screen. @@ -959,7 +980,22 @@ Draw rounded outer corners when the `drawbox` option is enabled. ## rulerfmt (string) (default ` %a| %p| \033[7;31m %m \033[0m| \033[7;33m %c \033[0m| \033[7;35m %s \033[0m| \033[7;36m %v \033[0m| \033[7;34m %f \033[0m| %i/%t`) Format string of the ruler shown in the bottom right corner. -Special expansions are provided, `%a` as the pressed keys, `%p` as the progress of file operations, `%m` as the number of files to be cut (moved), `%c` as the number of files to be copied, `%s` as the number of selected files, `%v` as the number of visually selected files, `%f` as the filter, `%i` as the position of the cursor, `%t` as the number of files shown in the current directory, `%h` as the number of files hidden in the current directory, `%P` as the scroll percentage, and `%d` as the amount of free disk space remaining. + +The following special expansions are supported: + + %a pressed keys + %p progress of file operations + %m number of files to be cut (moved) + %c number of files to be copied + %s number of selected files + %v number of visually selected files + %t number of shown files in the current directory + %h number of hidden files in the current directory + %f current filter + %i cursor position + %P scroll percentage + %d amount of free disk space + Additional expansions are provided for environment variables exported by lf, in the form `%{lf_}` (e.g. `%{lf_selmode}`). This is useful for displaying the current settings. Expansions are also provided for user-defined options, in the form `%{lf_user_}` (e.g. `%{lf_user_foo}`). The `|` character splits the format string into sections. Any section containing a failed expansion (result is a blank string) is discarded and not shown. @@ -1020,24 +1056,35 @@ This option has no effect when `ignoredia` is disabled. ## sortby (string) (default `natural`) Sort type for directories. -Currently supported sort types are `natural`, `name`, `size`, `time`, `atime`, `btime`, `ctime`, `ext` and `custom`. -Meaning of each sort type: +The following sort types are supported: natural file name (track_2.flac comes before track_10.flac) name file name (track_10.flac comes before track_2.flac) + ext file extension size file size time time of last data modification atime time of last access btime time of file birth ctime time of last status (inode) change - ext file extension - custom property defined via `addcustominfo` + custom property defined via `addcustominfo` (empty by default) ## statfmt (string) (default `\033[36m%p\033[0m| %c| %u| %g| %S| %t| -> %l`) Format string of the file info shown in the bottom left corner. -Special expansions are provided, `%p` as the file permissions, `%c` as the link count, `%u` as the user, `%g` as the group, `%s` as the file size, `%S` as the file size but with a fixed width of five characters (left-padded with spaces), `%t` as the last modified time, `%l` as the link target, `%m` as the current mode and `%M` as the current mode but also shown in Normal mode (displaying `NORMAL` instead of a blank string). + +The following special expansions are supported: + + %p file permission + %c link count + %u user name + %g group name + %s file size + %S file size (left-padded with spaces to a fixed width of 5 characters) + %t time of last data modification + %l link target + %m current mode + %M current mode (displaying `NORMAL` instead of a blank string in Normal mode) The `|` character splits the format string into sections. Any section containing a failed expansion (result is a blank string) is discarded and not shown. diff --git a/doc.txt b/doc.txt index af2f209b..78f061f2 100644 --- a/doc.txt +++ b/doc.txt @@ -915,9 +915,20 @@ Jump to the first match after each keystroke during searching. info ([]string) (default ``) A list of information that is shown for directory items at the right -side of the pane. Currently supported information types are size, time, -atime, btime, ctime, perm, user, group and custom. The custom type is -empty by default and can be updated using the addcustominfo command. +side of the pane. + +The following information types are supported: + + perm file permission + user user name + group group name + size file size + time time of last data modification + atime time of last access + btime time of file birth + ctime time of last status (inode) change + custom property defined via `addcustominfo` (empty by default) + Information is only shown when the pane width is more than twice the width of information. @@ -997,15 +1008,22 @@ option is left empty. promptfmt (string) (default \033[32;1m%u@%h\033[0m:\033[34;1m%d\033[0m\033[1m%f\033[0m) -Format string of the prompt shown in the top line. Special expansions -are provided, %u as the user name, %h as the hostname, %w as the working -directory, %d as the working directory with a trailing path separator, -%f as the filename, and %F as the current filter. %S may be used once -and will provide a spacer so that the following parts are right-aligned -on the screen. The home folder is shown as ~ in the working directory -expansion. Directory names are automatically shortened to a single -character starting from the leftmost parent when the prompt does not fit -the screen. +Format string of the prompt shown in the top line. + +The following special expansions are supported: + + %f file name + %h host name + %u user name + %w working directory + %d working directory (with trailing path separator) + %F current filter + %S spacer to right-align the following parts (can be used once) + +The home folder is shown as ~ in the working directory expansion. +Directory names are automatically shortened to a single character +starting from the leftmost parent when the prompt does not fit the +screen. ratios ([]int) (default 1:2:3) @@ -1029,18 +1047,27 @@ Draw rounded outer corners when the drawbox option is enabled. rulerfmt (string) (default %a| %p| \033[7;31m %m \033[0m| \033[7;33m %c \033[0m| \033[7;35m %s \033[0m| \033[7;36m %v \033[0m| \033[7;34m %f \033[0m| %i/%t) -Format string of the ruler shown in the bottom right corner. Special -expansions are provided, %a as the pressed keys, %p as the progress of -file operations, %m as the number of files to be cut (moved), %c as the -number of files to be copied, %s as the number of selected files, %v as -the number of visually selected files, %f as the filter, %i as the -position of the cursor, %t as the number of files shown in the current -directory, %h as the number of files hidden in the current directory, %P -as the scroll percentage, and %d as the amount of free disk space -remaining. Additional expansions are provided for environment variables -exported by lf, in the form %{lf_} (e.g. %{lf_selmode}). This is -useful for displaying the current settings. Expansions are also provided -for user-defined options, in the form %{lf_user_} (e.g. +Format string of the ruler shown in the bottom right corner. + +The following special expansions are supported: + + %a pressed keys + %p progress of file operations + %m number of files to be cut (moved) + %c number of files to be copied + %s number of selected files + %v number of visually selected files + %t number of shown files in the current directory + %h number of hidden files in the current directory + %f current filter + %i cursor position + %P scroll percentage + %d amount of free disk space + +Additional expansions are provided for environment variables exported by +lf, in the form %{lf_} (e.g. %{lf_selmode}). This is useful for +displaying the current settings. Expansions are also provided for +user-defined options, in the form %{lf_user_} (e.g. %{lf_user_foo}). The | character splits the format string into sections. Any section containing a failed expansion (result is a blank string) is discarded and not shown. @@ -1104,30 +1131,36 @@ diacritic. This option has no effect when ignoredia is disabled. sortby (string) (default natural) -Sort type for directories. Currently supported sort types are natural, -name, size, time, atime, btime, ctime, ext and custom. +Sort type for directories. -Meaning of each sort type: +The following sort types are supported: natural file name (track_2.flac comes before track_10.flac) name file name (track_10.flac comes before track_2.flac) + ext file extension size file size time time of last data modification atime time of last access btime time of file birth ctime time of last status (inode) change - ext file extension - custom property defined via `addcustominfo` + custom property defined via `addcustominfo` (empty by default) statfmt (string) (default \033[36m%p\033[0m| %c| %u| %g| %S| %t| -> %l) -Format string of the file info shown in the bottom left corner. Special -expansions are provided, %p as the file permissions, %c as the link -count, %u as the user, %g as the group, %s as the file size, %S as the -file size but with a fixed width of five characters (left-padded with -spaces), %t as the last modified time, %l as the link target, %m as the -current mode and %M as the current mode but also shown in Normal mode -(displaying NORMAL instead of a blank string). +Format string of the file info shown in the bottom left corner. + +The following special expansions are supported: + + %p file permission + %c link count + %u user name + %g group name + %s file size + %S file size (left-padded with spaces to a fixed width of 5 characters) + %t time of last data modification + %l link target + %m current mode + %M current mode (displaying `NORMAL` instead of a blank string in Normal mode) The | character splits the format string into sections. Any section containing a failed expansion (result is a blank string) is discarded diff --git a/lf.1 b/lf.1 index 6cce364e..85d0625a 100644 --- a/lf.1 +++ b/lf.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 3.7.0.2 .\" -.TH "LF" "1" "2025\-09\-17" "r38" "DOCUMENTATION" +.TH "LF" "1" "2025\-09\-18" "r38" "DOCUMENTATION" .SH NAME lf \- terminal file manager .SH SYNOPSIS @@ -802,12 +802,21 @@ Jump to the first match after each keystroke during searching. .SS info ([]string) (default \(ga\(ga) A list of information that is shown for directory items at the right side of the pane. -Currently supported information types are \f[CR]size\f[R], -\f[CR]time\f[R], \f[CR]atime\f[R], \f[CR]btime\f[R], \f[CR]ctime\f[R], -\f[CR]perm\f[R], \f[CR]user\f[R], \f[CR]group\f[R] and -\f[CR]custom\f[R]. -The \f[CR]custom\f[R] type is empty by default and can be updated using -the \f[CR]addcustominfo\f[R] command. +.PP +The following information types are supported: +.IP +.EX +perm file permission +user user name +group group name +size file size +time time of last data modification +atime time of last access +btime time of file birth +ctime time of last status (inode) change +custom property defined via \(gaaddcustominfo\(ga (empty by default) +.EE +.PP Information is only shown when the pane width is more than twice the width of information. .SS infotimefmtnew (string) (default \f[CR]Jan _2 15:04\f[R]) @@ -869,12 +878,19 @@ Preview filtering is disabled and files are displayed as they are when the value of this option is left empty. .SS promptfmt (string) (default \f[CR]\(rs033[32;1m%u\(at%h\(rs033[0m:\(rs033[34;1m%d\(rs033[0m\(rs033[1m%f\(rs033[0m\f[R]) Format string of the prompt shown in the top line. -Special expansions are provided, \f[CR]%u\f[R] as the user name, -\f[CR]%h\f[R] as the hostname, \f[CR]%w\f[R] as the working directory, -\f[CR]%d\f[R] as the working directory with a trailing path separator, -\f[CR]%f\f[R] as the filename, and \f[CR]%F\f[R] as the current filter. -\f[CR]%S\f[R] may be used once and will provide a spacer so that the -following parts are right\-aligned on the screen. +.PP +The following special expansions are supported: +.IP +.EX +%f file name +%h host name +%u user name +%w working directory +%d working directory (with trailing path separator) +%F current filter +%S spacer to right\-align the following parts (can be used once) +.EE +.PP The home folder is shown as \f[CR]\(ti\f[R] in the working directory expansion. Directory names are automatically shortened to a single character @@ -896,16 +912,24 @@ Draw rounded outer corners when the \f[CR]drawbox\f[R] option is enabled. .SS rulerfmt (string) (default \f[CR] %a| %p| \(rs033[7;31m %m \(rs033[0m| \(rs033[7;33m %c \(rs033[0m| \(rs033[7;35m %s \(rs033[0m| \(rs033[7;36m %v \(rs033[0m| \(rs033[7;34m %f \(rs033[0m| %i/%t\f[R]) Format string of the ruler shown in the bottom right corner. -Special expansions are provided, \f[CR]%a\f[R] as the pressed keys, -\f[CR]%p\f[R] as the progress of file operations, \f[CR]%m\f[R] as the -number of files to be cut (moved), \f[CR]%c\f[R] as the number of files -to be copied, \f[CR]%s\f[R] as the number of selected files, -\f[CR]%v\f[R] as the number of visually selected files, \f[CR]%f\f[R] as -the filter, \f[CR]%i\f[R] as the position of the cursor, \f[CR]%t\f[R] -as the number of files shown in the current directory, \f[CR]%h\f[R] as -the number of files hidden in the current directory, \f[CR]%P\f[R] as -the scroll percentage, and \f[CR]%d\f[R] as the amount of free disk -space remaining. +.PP +The following special expansions are supported: +.IP +.EX +%a pressed keys +%p progress of file operations +%m number of files to be cut (moved) +%c number of files to be copied +%s number of selected files +%v number of visually selected files +%t number of shown files in the current directory +%h number of hidden files in the current directory +%f current filter +%i cursor position +%P scroll percentage +%d amount of free disk space +.EE +.PP Additional expansions are provided for environment variables exported by lf, in the form \f[CR]%{lf_}\f[R] (e.g. \f[CR]%{lf_selmode}\f[R]). @@ -962,33 +986,37 @@ character with diacritic. This option has no effect when \f[CR]ignoredia\f[R] is disabled. .SS sortby (string) (default \f[CR]natural\f[R]) Sort type for directories. -Currently supported sort types are \f[CR]natural\f[R], \f[CR]name\f[R], -\f[CR]size\f[R], \f[CR]time\f[R], \f[CR]atime\f[R], \f[CR]btime\f[R], -\f[CR]ctime\f[R], \f[CR]ext\f[R] and \f[CR]custom\f[R]. .PP -Meaning of each sort type: +The following sort types are supported: .IP .EX natural file name (track_2.flac comes before track_10.flac) name file name (track_10.flac comes before track_2.flac) +ext file extension size file size time time of last data modification atime time of last access btime time of file birth ctime time of last status (inode) change -ext file extension -custom property defined via \(gaaddcustominfo\(ga +custom property defined via \(gaaddcustominfo\(ga (empty by default) .EE .SS statfmt (string) (default \f[CR]\(rs033[36m%p\(rs033[0m| %c| %u| %g| %S| %t| \-> %l\f[R]) Format string of the file info shown in the bottom left corner. -Special expansions are provided, \f[CR]%p\f[R] as the file permissions, -\f[CR]%c\f[R] as the link count, \f[CR]%u\f[R] as the user, -\f[CR]%g\f[R] as the group, \f[CR]%s\f[R] as the file size, -\f[CR]%S\f[R] as the file size but with a fixed width of five characters -(left\-padded with spaces), \f[CR]%t\f[R] as the last modified time, -\f[CR]%l\f[R] as the link target, \f[CR]%m\f[R] as the current mode and -\f[CR]%M\f[R] as the current mode but also shown in Normal mode -(displaying \f[CR]NORMAL\f[R] instead of a blank string). +.PP +The following special expansions are supported: +.IP +.EX +%p file permission +%c link count +%u user name +%g group name +%s file size +%S file size (left\-padded with spaces to a fixed width of 5 characters) +%t time of last data modification +%l link target +%m current mode +%M current mode (displaying \(gaNORMAL\(ga instead of a blank string in Normal mode) +.EE .PP The \f[CR]|\f[R] character splits the format string into sections. Any section containing a failed expansion (result is a blank string) is