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

+68 -70
View File
@@ -307,7 +307,7 @@ effects:
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.
@@ -507,7 +507,7 @@ statline.
shell-wait (modal) (default !)
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.
shell-async (modal) (default &)
@@ -515,12 +515,12 @@ Read a shell command to execute asynchronously without standard I/O.
find (modal) (default f), find-back (modal) (default F), find-next (default ;), find-prev (default ,)
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.
search (default /), search-back (default ?), search-next (default n), search-prev (default N)
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.
filter (modal), setfilter
@@ -552,7 +552,7 @@ can define a new tag-clearing command by combining tag with tag-toggle
tag-toggle (default t)
Tag a file with * or a single width character given in the argument if
Tag a file with * or a single-width character given in the argument if
the file is untagged, otherwise remove the tag.
echo
@@ -651,7 +651,7 @@ with cmd-delete-back (<backspace> 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
of letters and digits, and a Unix word consists of any non-blank
characters.
cmd-insert
@@ -715,7 +715,7 @@ Delete everything up to the beginning/end of the line.
cmd-delete-unix-word (default <c-w>)
Delete the previous unix word.
Delete the previous Unix word.
cmd-yank (default <c-y>)
@@ -751,8 +751,8 @@ Character : is used as the separator for list options []int and
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.
autoquit (bool) (default true)
@@ -768,16 +768,16 @@ cleaner (string) (default ``) (not called if empty)
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, (2) width, (3)
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 cleaning is
and (6) next filename to be previewed respectively. Preview cleaning is
disabled when the value of this option is left empty.
copyfmt (string) (default \033[7;33m)
Format string of the indicator for files to be copied.
cursoractivefmt (string) (default \033[7m), cursorparentfmt string (default \033[7m), cursorpreviewfmt string (default \033[4m)
cursoractivefmt (string) (default \033[7m), cursorparentfmt (string) (default \033[7m), cursorpreviewfmt (string) (default \033[4m)
Format strings for highlighting the cursor. cursoractivefmt applies in
the current directory pane, cursorparentfmt applies in panes that show
@@ -833,10 +833,10 @@ Draw boxes around panes with box drawing characters.
dupfilefmt (string) (default %f.~%n~)
Format string of file name when creating duplicate files. With the
Format string of filename when creating duplicate files. With the
default format, copying a file abc.txt to the same directory will result
in a duplicate file called abc.txt.~1~. Special expansions are provided,
%f as the file name, %b for the basename (file name without extension),
%f as the file name, %b for the base name (file name without extension),
%e as the extension (including the dot) and %n as the number of
duplicates.
@@ -986,8 +986,8 @@ previewer (string) (default ``) (not filtered if empty)
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, (2) width, (3) height,
(4) horizontal position, and (5) vertical position of preview pane
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. If the
previewer returns a non-zero exit code, then the preview cache for the
given file is disabled. This means that if the file is selected in the
@@ -1000,8 +1000,8 @@ promptfmt (string) (default \033[32;1m%u@%h\033[0m:\033[34;1m%d\033[0m\033[1m%f\
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 file name, and %F as the current filter. %S may be used once
and will provide a spacer so that the following parts are right aligned
%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
@@ -1049,15 +1049,15 @@ scrolloff (int) (default 0)
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
when this option is set to a 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.
searchmethod (string) default text)
searchmethod (string) (default text)
How search command patterns are treated. Currently supported methods are
text (i.e. string literals), glob (i.e shell globs) and regex (i.e.
text (i.e. string literals), glob (i.e. shell globs) and regex (i.e.
regular expressions). See SEARCHING FILES for more details.
selectfmt (string) (default \033[7;35m)
@@ -1160,7 +1160,7 @@ Format string of the file modification time shown in the bottom line.
truncatechar (string) (default ~)
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.
truncatepct (int) (default 100)
@@ -1259,7 +1259,7 @@ configuration file (e.g. ~/.bashrc).
OPENER
If this variable is set in the environment, use the same value.
Otherwise, this is set to start in Windows, open in MacOS, xdg-open in
Otherwise, this is set to start in Windows, open in macOS, xdg-open in
others.
EDITOR
@@ -1381,7 +1381,7 @@ PREFIXES
The following command prefixes are used by lf:
: 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
@@ -1412,8 +1412,8 @@ string:
set hidden false # boolean disable
set hidden! # boolean toggle
set scrolloff 10 # integer value
set sortby time # string value w/o quotes
set sortby 'time' # string value with single quotes (whitespaces)
set sortby time # string value without quotes
set sortby 'time' # string value with single quotes (whitespace)
set sortby "time" # string value with double quotes (backslash escapes)
Command setlocal is used to set a local option for a directory which can
@@ -1427,16 +1427,16 @@ the given directory along with its subdirectories:
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 'time' # string value with single quotes (whitespaces)
setlocal /foo/bar sortby time # string value without quotes
setlocal /foo/bar sortby 'time' # string value with single quotes (whitespace)
setlocal /foo/bar sortby "time" # string value with double quotes (backslash escapes)
setlocal /foo/bar hidden # for only '/foo/bar' directory
setlocal /foo/bar/ hidden # for '/foo/bar' and its subdirectories (e.g. '/foo/bar/baz')
Command map is used to bind a key in Normal and Visual mode to a command
which can be a builtin command, custom command, or shell command:
which can be a built-in command, custom command, or shell command:
map gh cd ~ # builtin command
map gh cd ~ # built-in command
map D trash # custom command
map i $less $f # shell command
map U !du -csh * # waiting shell command
@@ -1496,7 +1496,7 @@ Regular keys are assigned to a command with the usual syntax:
map a down
Keys combined with the shift key simply use the uppercase letter:
Keys combined with the Shift key simply use the uppercase letter:
map A down
@@ -1514,21 +1514,21 @@ Function keys are prefixed with f character:
map <f-1> down
Keys combined with the control key are prefixed with a c character:
Keys combined with the Ctrl key are prefixed with a c character:
map <c-a> down
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. On these
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:
map á down
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 terminals (delay is 100ms). On these
terminals, keys combined with the alt key are prefixed with an a
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 a
character:
map <a-a> down
@@ -1640,7 +1640,7 @@ 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 message without
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. This can
cause flickering on the screen for short commands and similar
@@ -1652,14 +1652,14 @@ 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.
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:
cmd rename %mv -i $f $1
You can also output error messages in the command and it will show up in
the statline. For example, an alternative rename command may look like
this:
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:
cmd rename %[ -e $1 ] && printf "file exists" || mv $f $1
@@ -1708,7 +1708,7 @@ send a command to a single client:
lf -remote 'send 1234 echo hello world'
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 $id variable
is exported to the environment for shell commands. The value of this
variable is set to the process ID of the client. You can use it to send
@@ -1733,7 +1733,7 @@ UI with respect to the terminal width as follows:
}}
In addition, the query command can be used to obtain information about a
specific lf instance by providing its id:
specific lf instance by providing its ID:
lf -remote "query $id maps"
@@ -1792,8 +1792,8 @@ named pipes, and sockets are skipped and links are not followed. 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.
message line as well as the log file and they do not prematurely
terminate the corresponding file operation.
File operations can be performed on the currently selected file or on
multiple files by selecting them first. When you copy a file, lf doesn't
@@ -1864,14 +1864,14 @@ zero, then the keys are read until there is only a single match. The
default values of these two options are set to jump to the first file
with the given initial.
Some options effect both searching and finding. You can disable wrapscan
Some options affect both searching and finding. You can disable wrapscan
option to prevent searches from being wrapped around at the end of the
file list. You can disable ignorecase option to match cases in the
pattern and the filename. This option is already automatically
overridden if the pattern contains upper-case characters. You can
disable smartcase option to disable this behavior. Two similar options
ignoredia and smartdia are provided to control matching diacritics in
Latin letters.
overridden if the pattern contains uppercase characters. You can disable
smartcase option to disable this behavior. Two similar options ignoredia
and smartdia are provided to control matching diacritics in Latin
letters.
OPENING FILES
@@ -1886,7 +1886,7 @@ It is possible to use different command types:
cmd open &xdg-open $f
You may want to use either file extensions or mime types from file
You may want to use either file extensions or MIME types from file
command:
cmd open ${{
@@ -1928,12 +1928,12 @@ PREVIEWING FILES
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 files or view PDF or
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.
To use this feature, you need to set the value of previewer option to
the path of an executable file. Five arguments are passed to the file,
(1) current file name, (2) width, (3) height, (4) horizontal position,
(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. You may also want to use
the same script in your pager mapping as well:
@@ -1951,7 +1951,7 @@ still be displayed in the statusline below:
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 file command.
efficiently compared to obtaining MIME types from file command.
Extensions can then be used to match cleanly within a conditional:
#!/bin/sh
@@ -2099,7 +2099,7 @@ environment variables possibly by overwriting its previous values.
Colors are set in the following order:
1. default
2. LSCOLORS (Mac/BSD ls)
2. LSCOLORS (macOS/BSD ls)
3. LS_COLORS (GNU ls)
4. LF_COLORS (lf specific)
5. colors file (lf specific)
@@ -2231,7 +2231,7 @@ escaping newlines with backslashes as follows:
"
The ln entry supports the special value target, which will use the link
target to select a style. File name rules will still apply based on the
target to select a style. Filename rules will still apply based on the
link's name -- this mirrors GNU's ls and dircolors behavior. Having such
a long variable definition in a shell configuration file might be
undesirable. You may instead use the colors file (refer to the
@@ -2244,19 +2244,17 @@ ICONS
Icons are configured using LF_ICONS environment variable or an icons
file (refer to the CONFIGURATION section). The variable uses the same
syntax as LS_COLORS/LF_COLORS. Instead of colors, you should put a
single characters as values of entries. The ln entry supports the
special value target, which will use the link target to select a icon.
File name rules will still apply based on the link's name -- this
mirrors GNU's ls and dircolors behavior. The icons file (refer to the
CONFIGURATION section) should consist of whitespace-separated arrays
with a # 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. Do not forget to add set icons true to your lfrc to
see the icons. Default values are as follows given with their matching
order in lf:
syntax as LS_COLORS/LF_COLORS. Instead of colors, you should use single
characters or symbols as values. The ln entry supports the special value
target, which will use the link target to select a icon. Filename rules
will still apply based on the link's name -- this mirrors GNU's ls and
dircolors behavior. The icons file (refer to the CONFIGURATION section)
should consist of whitespace-separated arrays with a # character to
start comments until the end of the line. 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 set icons true to your lfrc to see the icons.
Default values are listed below in the order lf matches them:
ln l
or l