Update documentation (#2149)

* Fix typos

* Unify spelling

* Improve grammar and wording

* Update usage of `filename` and `file name`

* Prefer `without` over `w/o`

* Generate docs
This commit is contained in:
CatsDeservePets authored and GitHub committed 2025-09-18 13:41:24 +10:00
1 parent d2e125d264
commit c5075b6455
3 files changed
+182 -186

No files matched your search

+62 -64
View File
@@ -1,13 +1,13 @@
.\" Automatically generated by Pandoc 3.7.0.2
.\"
.TH "LF" "1" "2025\-09\-09" "r38" "DOCUMENTATION"
.TH "LF" "1" "2025\-09\-17" "r38" "DOCUMENTATION"
.SH NAME
lf \- terminal file manager
.SH SYNOPSIS
\f[B]lf\f[R] [\f[B]\-command\f[R] \f[I]command\f[R]] [\f[B]\-config\f[R]
\f[I]path\f[R]] [\f[B]\-cpuprofile\f[R] \f[I]path\f[R]]
[\f[B]\-doc\f[R]] [\f[B]\-last\-dir\-path\f[R] \f[I]path\f[R]]
[\f[B]\-log path\f[R]] [\f[B]\-memprofile\f[R] \f[I]path\f[R]]
[\f[B]\-log\f[R] \f[I]path\f[R]] [\f[B]\-memprofile\f[R] \f[I]path\f[R]]
[\f[B]\-print\-last\-dir\f[R]] [\f[B]\-print\-selection\f[R]]
[\f[B]\-remote\f[R] \f[I]command\f[R]] [\f[B]\-selection\-path\f[R]
\f[I]path\f[R]] [\f[B]\-server\f[R]] [\f[B]\-single\f[R]]
@@ -333,7 +333,7 @@ Left mouse button
Click on a file or directory to select it.
Right mouse button
Enter a directory or open a file. Also works on the preview window.
Enter a directory or open a file. Also works on the preview pane.
Scroll wheel
Move up or down. If Ctrl is pressed, scroll up or down.
@@ -501,14 +501,14 @@ Read a shell command to execute.
Read a shell command to execute piping its standard I/O to the bottom
statline.
.SS shell\-wait (modal) (default \f[CR]!\f[R])
Read a shell command to execute and wait for a key press in the end.
Read a shell command to execute and wait for a key press at the end.
.SS shell\-async (modal) (default \f[CR]&\f[R])
Read a shell command to execute asynchronously without standard I/O.
.SS find (modal) (default \f[CR]f\f[R]), find\-back (modal) (default \f[CR]F\f[R]), find\-next (default \f[CR];\f[R]), find\-prev (default \f[CR],\f[R])
Read key(s) to find the appropriate file name match in the
Read key(s) to find the appropriate filename match in the
forward/backward direction and jump to the next/previous match.
.SS search (default \f[CR]/\f[R]), search\-back (default \f[CR]?\f[R]), search\-next (default \f[CR]n\f[R]), search\-prev (default \f[CR]N\f[R])
Read a pattern to search for a file name match in the forward/backward
Read a pattern to search for a filename match in the forward/backward
direction and jump to the next/previous match.
.SS filter (modal), setfilter
Command \f[CR]filter\f[R] reads a pattern to filter out and only view
@@ -532,7 +532,7 @@ You can define a new tag\-clearing command by combining \f[CR]tag\f[R]
with \f[CR]tag\-toggle\f[R] (i.e.
\f[CR]cmd tag\-clear :tag; tag\-toggle\f[R]).
.SS tag\-toggle (default \f[CR]t\f[R])
Tag a file with \f[CR]*\f[R] or a single width character given in the
Tag a file with \f[CR]*\f[R] or a single\-width character given in the
argument if the file is untagged, otherwise remove the tag.
.SS echo
Print the given arguments to the message line at the bottom.
@@ -609,7 +609,7 @@ You can go back with \f[CR]cmd\-delete\-back\f[R]
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.
and digits, and a Unix word consists of any non\-blank characters.
.SS cmd\-insert
Insert the character given in the argument.
This command is automatically called when required.
@@ -645,7 +645,7 @@ When at the beginning of a prompt, returns either to Normal mode or to
.SS cmd\-delete\-home (default \f[CR]<c\-u>\f[R]), cmd\-delete\-end (default \f[CR]<c\-k>\f[R])
Delete everything up to the beginning/end of the line.
.SS cmd\-delete\-unix\-word (default \f[CR]<c\-w>\f[R])
Delete the previous unix word.
Delete the previous Unix word.
.SS cmd\-yank (default \f[CR]<c\-y>\f[R])
Paste the buffer content containing the last deleted item.
.SS cmd\-transpose (default \f[CR]<c\-t>\f[R]), cmd\-transpose\-word (default \f[CR]<a\-t>\f[R])
@@ -665,8 +665,8 @@ Character \f[CR]:\f[R] is used as the separator for list options
\f[CR][]int\f[R] and \f[CR][]string\f[R].
.SS anchorfind (bool) (default true)
When this option is enabled, the find command starts matching patterns
from the beginning of file names, otherwise, it can match at an
arbitrary position.
from the beginning of filenames, otherwise, it can match at an arbitrary
position.
.SS autoquit (bool) (default true)
Automatically quit the server when there are no clients left connected.
.SS borderfmt (string) (default \f[CR]\(rs033[0m\f[R])
@@ -677,14 +677,14 @@ Set the path of a cleaner file.
The file should be executable.
This file is called if previewing is enabled, the previewer is set, and
the previously selected file has its preview cache disabled.
The following arguments are passed to the file, (1) current file name,
The following arguments are passed to the file, (1) current filename,
(2) width, (3) height, (4) horizontal position, (5) vertical position of
preview pane and (6) next file name to be previewed respectively.
preview pane and (6) next filename to be previewed respectively.
Preview cleaning is disabled when the value of this option is left
empty.
.SS copyfmt (string) (default \f[CR]\(rs033[7;33m\f[R])
Format string of the indicator for files to be copied.
.SS cursoractivefmt (string) (default \f[CR]\(rs033[7m\f[R]), cursorparentfmt string (default \f[CR]\(rs033[7m\f[R]), cursorpreviewfmt string (default \f[CR]\(rs033[4m\f[R])
.SS cursoractivefmt (string) (default \f[CR]\(rs033[7m\f[R]), cursorparentfmt (string) (default \f[CR]\(rs033[7m\f[R]), cursorpreviewfmt (string) (default \f[CR]\(rs033[4m\f[R])
Format strings for highlighting the cursor.
\f[CR]cursoractivefmt\f[R] applies in the current directory pane,
\f[CR]cursorparentfmt\f[R] applies in panes that show parents of the
@@ -731,12 +731,12 @@ This allows custom previews for directories.
.SS drawbox (bool) (default false)
Draw boxes around panes with box drawing characters.
.SS dupfilefmt (string) (default \f[CR]%f.\(ti%n\(ti\f[R])
Format string of file name when creating duplicate files.
Format string of filename when creating duplicate files.
With the default format, copying a file \f[CR]abc.txt\f[R] to the same
directory will result in a duplicate file called
\f[CR]abc.txt.\(ti1\(ti\f[R].
Special expansions are provided, \f[CR]%f\f[R] as the file name,
\f[CR]%b\f[R] for the basename (file name without extension),
\f[CR]%b\f[R] for the base name (file name without extension),
\f[CR]%e\f[R] as the extension (including the dot) and \f[CR]%n\f[R] as
the number of duplicates.
.SS errorfmt (string) (default \f[CR]\(rs033[7;31;47m\f[R])
@@ -857,7 +857,7 @@ considered binary files and displayed as \f[CR]binary\f[R].
Set the path of a previewer file to filter the content of regular files
for previewing.
The file should be executable.
The following arguments are passed to the file, (1) current file name,
The following arguments are passed to the file, (1) current filename,
(2) width, (3) height, (4) horizontal position, and (5) vertical
position of preview pane respectively.
SIGPIPE signal is sent when enough lines are read.
@@ -872,9 +872,9 @@ 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 file name, and \f[CR]%F\f[R] as the current filter.
\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.
following parts are right\-aligned on the screen.
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
@@ -920,14 +920,14 @@ discarded and not shown.
Minimum number of offset lines shown at all times at the top and bottom
of the screen when scrolling.
The current line is kept in the middle when this option is set to a
large value that is bigger than the half of number of lines.
large value that is bigger than half the number of lines.
A smaller offset can be used when the current file is close to the
beginning or end of the list to show the maximum number of items.
.SS searchmethod (string) default \f[CR]text\f[R])
.SS searchmethod (string) (default \f[CR]text\f[R])
How search command patterns are treated.
Currently supported methods are \f[CR]text\f[R] (i.e.
string literals), \f[CR]glob\f[R] (i.e shell globs) and \f[CR]regex\f[R]
(i.e.
string literals), \f[CR]glob\f[R] (i.e.
shell globs) and \f[CR]regex\f[R] (i.e.
regular expressions).
See \f[CR]SEARCHING FILES\f[R] for more details.
.SS selectfmt (string) (default \f[CR]\(rs033[7;35m\f[R])
@@ -1015,7 +1015,7 @@ temporary and it does not need to be specified.
.SS timefmt (string) (default \f[CR]Mon Jan _2 15:04:05 2006\f[R])
Format string of the file modification time shown in the bottom line.
.SS truncatechar (string) (default \f[CR]\(ti\f[R])
The truncate character that is shown at the end when the file name does
The truncate character that is shown at the end when the filename does
not fit into the pane.
.SS truncatepct (int) (default 100)
When a filename is too long to be shown completely, the available space
@@ -1092,7 +1092,7 @@ in your shell configuration file (e.g.
.SS OPENER
If this variable is set in the environment, use the same value.
Otherwise, this is set to \f[CR]start\f[R] in Windows, \f[CR]open\f[R]
in MacOS, \f[CR]xdg\-open\f[R] in others.
in macOS, \f[CR]xdg\-open\f[R] in others.
.SS EDITOR
If VISUAL is set in the environment, use its value.
Otherwise, use the value of the environment variable EDITOR.
@@ -1173,7 +1173,7 @@ This shell command can be defined to be executed before quitting.
The following command prefixes are used by lf:
.IP
.EX
: read (default) builtin/custom command
: read (default) built\-in/custom command
$ shell shell command
% shell\-pipe shell command running with the UI
! shell\-wait shell command waiting for a key press
@@ -1208,8 +1208,8 @@ set nohidden # boolean disable
set hidden false # boolean disable
set hidden! # boolean toggle
set scrolloff 10 # integer value
set sortby time # string value w/o quotes
set sortby \(aqtime\(aq # string value with single quotes (whitespaces)
set sortby time # string value without quotes
set sortby \(aqtime\(aq # string value with single quotes (whitespace)
set sortby \(dqtime\(dq # string value with double quotes (backslash escapes)
.EE
.PP
@@ -1228,19 +1228,19 @@ setlocal /foo/bar hidden true # boolean enable
setlocal /foo/bar nohidden # boolean disable
setlocal /foo/bar hidden false # boolean disable
setlocal /foo/bar hidden! # boolean toggle
setlocal /foo/bar sortby time # string value w/o quotes
setlocal /foo/bar sortby \(aqtime\(aq # string value with single quotes (whitespaces)
setlocal /foo/bar sortby time # string value without quotes
setlocal /foo/bar sortby \(aqtime\(aq # string value with single quotes (whitespace)
setlocal /foo/bar sortby \(dqtime\(dq # string value with double quotes (backslash escapes)
setlocal /foo/bar hidden # for only \(aq/foo/bar\(aq directory
setlocal /foo/bar/ hidden # for \(aq/foo/bar\(aq and its subdirectories (e.g. \(aq/foo/bar/baz\(aq)
.EE
.PP
Command \f[CR]map\f[R] is used to bind a key in Normal and Visual mode
to a command which can be a builtin command, custom command, or shell
to a command which can be a built\-in command, custom command, or shell
command:
.IP
.EX
map gh cd \(ti # builtin command
map gh cd \(ti # built\-in command
map D trash # custom command
map i $less $f # shell command
map U !du \-csh * # waiting shell command
@@ -1318,7 +1318,7 @@ Regular keys are assigned to a command with the usual syntax:
map a down
.EE
.PP
Keys combined with the shift key simply use the uppercase letter:
Keys combined with the Shift key simply use the uppercase letter:
.IP
.EX
map A down
@@ -1344,17 +1344,17 @@ Function keys are prefixed with \f[CR]f\f[R] character:
map <f\-1> down
.EE
.PP
Keys combined with the control key are prefixed with a \f[CR]c\f[R]
Keys combined with the Ctrl key are prefixed with a \f[CR]c\f[R]
character:
.IP
.EX
map <c\-a> down
.EE
.PP
Keys combined with the alt key are assigned in two different ways
Keys combined with the Alt key are assigned in two different ways
depending on the behavior of your terminal.
Older terminals (e.g.
xterm) may set the 8th bit of a character when the alt key is pressed.
xterm) may set the 8th bit of a character when the Alt key is pressed.
On these terminals, you can use the corresponding byte for the mapping:
.IP
.EX
@@ -1362,11 +1362,11 @@ map á down
.EE
.PP
Newer terminals (e.g.
gnome\-terminal) may prefix the key with an escape key when the alt key
is pressed.
lf uses the escape delaying mechanism to recognize alt keys in these
gnome\-terminal) may prefix the key with an escape character when the
Alt key is pressed.
lf uses the escape delaying mechanism to recognize Alt keys in these
terminals (delay is 100ms).
On these terminals, keys combined with the alt key are prefixed with an
On these terminals, keys combined with the Alt key are prefixed with an
\f[CR]a\f[R] character:
.IP
.EX
@@ -1506,7 +1506,7 @@ the rest of the documentation.
.SH PIPING SHELL COMMANDS
Regular shell commands have some limitations in some cases.
When an output or error message is given and the command exits
afterwards, the ui is immediately resumed and there is no way to see the
afterwards, the UI is immediately resumed and there is no way to see the
message without dropping to shell again.
Also, even when there is no output or error, the UI still needs to be
paused while the command is running.
@@ -1519,15 +1519,15 @@ This can be useful for programs following the Unix philosophy to give no
output in the success case, and brief error messages or prompts in other
cases.
.PP
For example, following rename command prompts for overwrite in the
For example, the following rename command prompts for overwrite in the
statline if there is an existing file with the given name:
.IP
.EX
cmd rename %mv \-i $f $1
.EE
.PP
You can also output error messages in the command and it will show up in
the statline.
You can also output error messages in the command and they will show up
in the statline.
For example, an alternative rename command may look like this:
.IP
.EX
@@ -1586,7 +1586,7 @@ client:
lf \-remote \(aqsend 1234 echo hello world\(aq
.EE
.PP
All clients have a unique id number but you may not be aware of the id
All clients have a unique ID number but you may not be aware of the ID
number when you are writing a command.
For this purpose, an \f[CR]$id\f[R] variable is exported to the
environment for shell commands.
@@ -1618,7 +1618,7 @@ cmd recol %{{
.EE
.PP
In addition, the \f[CR]query\f[R] command can be used to obtain
information about a specific lf instance by providing its id:
information about a specific lf instance by providing its ID:
.IP
.EX
lf \-remote \(dqquery $id maps\(dq
@@ -1691,7 +1691,7 @@ Moving is performed using the rename operation of the underlying OS.
For cross\-device moving, lf falls back to copying and then deletes the
original files if there are no errors.
Operation errors are shown in the message line as well as the log file
and they do not preemptively finish the corresponding file operation.
and they do not prematurely terminate the corresponding file operation.
.PP
File operations can be performed on the currently selected file or on
multiple files by selecting them first.
@@ -1786,13 +1786,13 @@ only a single match.
The default values of these two options are set to jump to the first
file with the given initial.
.PP
Some options effect both searching and finding.
Some options affect both searching and finding.
You can disable \f[CR]wrapscan\f[R] option to prevent searches from
being wrapped around at the end of the file list.
You can disable \f[CR]ignorecase\f[R] option to match cases in the
pattern and the filename.
This option is already automatically overridden if the pattern contains
upper\-case characters.
uppercase characters.
You can disable \f[CR]smartcase\f[R] option to disable this behavior.
Two similar options \f[CR]ignoredia\f[R] and \f[CR]smartdia\f[R] are
provided to control matching diacritics in Latin letters.
@@ -1813,7 +1813,7 @@ It is possible to use different command types:
cmd open &xdg\-open $f
.EE
.PP
You may want to use either file extensions or mime types from
You may want to use either file extensions or MIME types from
\f[CR]file\f[R] command:
.IP
.EX
@@ -1863,13 +1863,13 @@ lf previews files on the preview pane by printing the file until the end
or until 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
This can be used to highlight source code, list contents of archive
files or view PDF or image files to name a few.
For coloring lf recognizes ANSI escape codes.
.PP
To use this feature, you need to set the value of \f[CR]previewer\f[R]
option to the path of an executable file.
Five arguments are passed to the file, (1) current file name, (2) width,
Five arguments are passed to the file, (1) current filename, (2) width,
(3) height, (4) horizontal position, and (5) vertical position of
preview pane respectively.
The output of the execution is printed in the preview pane.
@@ -1892,7 +1892,7 @@ map i $LESSOPEN=\(aq| \(ti/.config/lf/pv.sh %s\(aq less \-R $f
Since this script is called for each file selection change it needs to
be as efficient as possible and this responsibility is left to the user.
You may use file extensions to determine the type of file more
efficiently compared to obtaining mime types from \f[CR]file\f[R]
efficiently compared to obtaining MIME types from \f[CR]file\f[R]
command.
Extensions can then be used to match cleanly within a conditional:
.IP
@@ -2060,7 +2060,7 @@ Colors are set in the following order:
.IP "1." 3
default
.IP "2." 3
LSCOLORS (Mac/BSD ls)
LSCOLORS (macOS/BSD ls)
.IP "3." 3
LS_COLORS (GNU ls)
.IP "4." 3
@@ -2243,7 +2243,7 @@ ex=01;32:\(rs
.PP
The \f[CR]ln\f[R] entry supports the special value \f[CR]target\f[R],
which will use the link target to select a style.
File name rules will still apply based on the link\(aqs name \-\- this
Filename rules will still apply based on the link\(aqs name \-\- this
mirrors GNU\(aqs \f[CR]ls\f[R] and \f[CR]dircolors\f[R] behavior.
Having such a long variable definition in a shell configuration file
might be undesirable.
@@ -2266,11 +2266,11 @@ CONFIGURATION section
.UE \c
).
The variable uses the same syntax as \f[CR]LS_COLORS/LF_COLORS\f[R].
Instead of colors, you should put a single characters as values of
entries.
Instead of colors, you should use single characters or symbols as
values.
The \f[CR]ln\f[R] entry supports the special value \f[CR]target\f[R],
which will use the link target to select a icon.
File name rules will still apply based on the link\(aqs name \-\- this
Filename rules will still apply based on the link\(aqs name \-\- this
mirrors GNU\(aqs \f[CR]ls\f[R] and \f[CR]dircolors\f[R] behavior.
The icons file (refer to the \c
.UR https://github.com/gokcehan/lf/blob/master/doc.md#configuration
@@ -2278,14 +2278,12 @@ CONFIGURATION section
.UE \c
) should consist of whitespace\-separated arrays with a \f[CR]#\f[R]
character to start comments until the end of the line.
Each line should contain 1\-3 columns, first column is filetype or
filename pattern, second column is the icon, third column is an optional
icon color.
If there is only one column, means to disable rule for this filetype or
pattern.
Each line should contain 1\-3 columns: a file type or file name pattern,
the icon, and an optional icon color.
Using only one column disables all rules for that type or name.
Do not forget to add \f[CR]set icons true\f[R] to your \f[CR]lfrc\f[R]
to see the icons.
Default values are as follows given with their matching order in lf:
Default values are listed below in the order lf matches them:
.IP
.EX
ln l