update doc

This commit is contained in:
Gokcehan 2019-03-03 22:12:33 +03:00
parent 4a8943b6b7
commit 31945fbcb5
3 changed files with 358 additions and 325 deletions

57
doc.go
View File

@ -56,15 +56,15 @@ The following commands are provided by lf without default keybindings:
draw draw the ui
load load modified files and directories
sync synchronizes copied/cut files with server
echo prints its arguments to the message line
sync synchronize copied/cut files with server
echo print arguments to the message line
echomsg same as echo but logging
echoerr same as echomsg but red color
cd changes working directory to its argument
select changes current file selection to its argument
source reads the configuration file in its argument
push simulates key pushes given in its argument
delete deletes the current file or selected file(s)
cd change working directory to the argument
select change current file selection to the argument
source read the configuration file in the argument
push simulate key pushes given in the argument
delete remove the current file or selected file(s)
The following command line commands are provided by lf with default
keybindings:
@ -519,33 +519,48 @@ should not be needed for users.
File Operations
lf uses the underlying 'cp' and 'mv' shell commands for file operations. For
this purpose, when you 'copy' a file, it doesn't actually copy the file on the
disk, but only records its name to memory. The actual file operation takes
place when you 'paste' in which case the 'cp' command is used. Similarly the
'mv' command is used for 'cut' followed by 'paste'.
lf uses its own builtin copy and move operations by default. These are
implemented as asynchronous operations and progress is shown in the bottom
ruler. These commands do not overwrite existing files or directories with the
same name. Instead, a suffix that is compatible with '--backup=numbered' option
in GNU cp is added to the new files or directories. Only file modes are
preserved and all other attributes are ignored including ownership, timestamps,
context, links, and xattr. Special files such as character and block devices,
named pipes, and sockets are skipped and links are followed. Moving is
performed using the rename operation of the underlying OS. This can fail to
move files between different partitions when it needs to copy files. For these
cases, users are expected to explicitly copy files and then delete the old ones
manually. Operation errors are shown in the message line as well as the log
file and they do not preemptively finish the corresponding file operation.
You can customize these operations by defining a 'paste' command. This is a
special command that is called when it is defined instead of the builtin
implementation. The default behavior is similar to the following command:
File operations can be performed on the current selected file or alternatively
on multiple files by marking them first. When you 'copy' a file, lf doesn't
actually copy the file on the disk, but only records its name to memory. The
actual file copying takes place when you 'paste'. Similarly 'paste' after a
'cut' operation moves the file.
You can customize copy and move operations by defining a 'paste' command. This
is a special command that is called when it is defined instead of the builtin
implementation. You can use the following example as a starting point:
cmd paste %{{
load=$(lf -remote 'load')
mode=$(echo "$load" | sed -n '1p')
list=$(echo "$load" | sed '1d')
if [ $mode = 'copy' ]; then
cp -R -n $list .
cp -R $list .
elif [ $mode = 'move' ]; then
mv -n $list .
mv $list .
fi
lf -remote 'send load'
lf -remote 'send clear'
}}
Some useful things are to use the backup option ('--backup') with 'cp' and 'mv'
commands if they support it (i.e. GNU implementation), change the command type
to asynchronous, or use 'rsync' command with progress bar option for copying
and feed the progress to the client periodically with remote 'echo' calls.
Some useful things to be considered are to use the backup ('--backup') and/or
preserve attributes ('-a') options with 'cp' and 'mv' commands if they support
it (i.e. GNU implementation), change the command type to asynchronous, or use
'rsync' command with progress bar option for copying and feed the progress to
the client periodically with remote 'echo' calls.
By default, lf does not assign 'delete' command to a key to protect new users.
You can customize file deletion by defining a 'delete' command. You can also

View File

@ -59,15 +59,15 @@ The following commands are provided by lf without default keybindings:
draw draw the ui
load load modified files and directories
sync synchronizes copied/cut files with server
echo prints its arguments to the message line
sync synchronize copied/cut files with server
echo print arguments to the message line
echomsg same as echo but logging
echoerr same as echomsg but red color
cd changes working directory to its argument
select changes current file selection to its argument
source reads the configuration file in its argument
push simulates key pushes given in its argument
delete deletes the current file or selected file(s)
cd change working directory to the argument
select change current file selection to the argument
source read the configuration file in the argument
push simulate key pushes given in the argument
delete remove the current file or selected file(s)
The following command line commands are provided by lf with default
keybindings:
@ -121,15 +121,15 @@ The following options can be used to customize the behavior of lf:
scrolloff integer (default 0)
tabstop integer (default 8)
filesep string (default "\n")
ifs string (default '') (not exported if empty)
previewer string (default '') (not filtered if empty)
ifs string (default ) (not exported if empty)
previewer string (default ) (not filtered if empty)
promptfmt string (default "\033[32;1m%u@%h\033[0m:\033[34;1m%w/\033[0m\033[1m%f\033[0m")
shell string (default 'sh')
sortby string (default 'natural')
timefmt string (default 'Mon Jan _2 15:04:05 2006')
ratios string (default '1:2:3')
info string (default '')
shellopts string (default '')
info string (default )
shellopts string (default )
The following variables are exported for shell commands:
@ -541,34 +541,50 @@ should not be needed for users.
File Operations
lf uses the underlying 'cp' and 'mv' shell commands for file operations. For
this purpose, when you 'copy' a file, it doesn't actually copy the file on
the disk, but only records its name to memory. The actual file operation
takes place when you 'paste' in which case the 'cp' command is used.
Similarly the 'mv' command is used for 'cut' followed by 'paste'.
lf uses its own builtin copy and move operations by default. These are
implemented as asynchronous operations and progress is shown in the bottom
ruler. These commands do not overwrite existing files or directories with
the same name. Instead, a suffix that is compatible with '--backup=numbered'
option in GNU cp is added to the new files or directories. Only file modes
are preserved and all other attributes are ignored including ownership,
timestamps, context, links, and xattr. Special files such as character and
block devices, named pipes, and sockets are skipped and links are followed.
Moving is performed using the rename operation of the underlying OS. This
can fail to move files between different partitions when it needs to copy
files. For these cases, users are expected to explicitly copy files and then
delete the old ones manually. Operation errors are shown in the message line
as well as the log file and they do not preemptively finish the
corresponding file operation.
You can customize these operations by defining a 'paste' command. This is a
special command that is called when it is defined instead of the builtin
implementation. The default behavior is similar to the following command:
File operations can be performed on the current selected file or
alternatively on multiple files by marking them first. When you 'copy' a
file, lf doesn't actually copy the file on the disk, but only records its
name to memory. The actual file copying takes place when you 'paste'.
Similarly 'paste' after a 'cut' operation moves the file.
You can customize copy and move operations by defining a 'paste' command.
This is a special command that is called when it is defined instead of the
builtin implementation. You can use the following example as a starting
point:
cmd paste %{{
load=$(lf -remote 'load')
mode=$(echo "$load" | sed -n '1p')
list=$(echo "$load" | sed '1d')
if [ $mode = 'copy' ]; then
cp -R -n $list .
cp -R $list .
elif [ $mode = 'move' ]; then
mv -n $list .
mv $list .
fi
lf -remote 'send load'
lf -remote 'send clear'
}}
Some useful things are to use the backup option ('--backup') with 'cp' and
'mv' commands if they support it (i.e. GNU implementation), change the
command type to asynchronous, or use 'rsync' command with progress bar
option for copying and feed the progress to the client periodically with
remote 'echo' calls.
Some useful things to be considered are to use the backup ('--backup')
and/or preserve attributes ('-a') options with 'cp' and 'mv' commands if
they support it (i.e. GNU implementation), change the command type to
asynchronous, or use 'rsync' command with progress bar option for copying
and feed the progress to the client periodically with remote 'echo' calls.
By default, lf does not assign 'delete' command to a key to protect new
users. You can customize file deletion by defining a 'delete' command. You

34
lf.1
View File

@ -68,15 +68,15 @@ The following commands are provided by lf without default keybindings:
.EX
draw draw the ui
load load modified files and directories
sync synchronizes copied/cut files with server
echo prints its arguments to the message line
sync synchronize copied/cut files with server
echo print arguments to the message line
echomsg same as echo but logging
echoerr same as echomsg but red color
cd changes working directory to its argument
select changes current file selection to its argument
source reads the configuration file in its argument
push simulates key pushes given in its argument
delete deletes the current file or selected file(s)
cd change working directory to the argument
select change current file selection to the argument
source read the configuration file in the argument
push simulate key pushes given in the argument
delete remove the current file or selected file(s)
.EE
.PP
The following command line commands are provided by lf with default keybindings:
@ -133,15 +133,15 @@ The following options can be used to customize the behavior of lf:
scrolloff integer (default 0)
tabstop integer (default 8)
filesep string (default "\en")
ifs string (default '') (not exported if empty)
previewer string (default '') (not filtered if empty)
ifs string (default ”) (not exported if empty)
previewer string (default ”) (not filtered if empty)
promptfmt string (default "\e033[32;1m%u@%h\e033[0m:\e033[34;1m%w/\e033[0m\e033[1m%f\e033[0m")
shell string (default 'sh')
sortby string (default 'natural')
timefmt string (default 'Mon Jan _2 15:04:05 2006')
ratios string (default '1:2:3')
info string (default '')
shellopts string (default '')
info string (default ”)
shellopts string (default ”)
.EE
.PP
The following variables are exported for shell commands:
@ -530,9 +530,11 @@ There is a 'quit' command to close client connections and quit the server:
.PP
Lastly, there is a 'conn' command to connect the server as a client. This should not be needed for users.
.SH FILE OPERATIONS
lf uses the underlying 'cp' and 'mv' shell commands for file operations. For this purpose, when you 'copy' a file, it doesn't actually copy the file on the disk, but only records its name to memory. The actual file operation takes place when you 'paste' in which case the 'cp' command is used. Similarly the 'mv' command is used for 'cut' followed by 'paste'.
lf uses its own builtin copy and move operations by default. These are implemented as asynchronous operations and progress is shown in the bottom ruler. These commands do not overwrite existing files or directories with the same name. Instead, a suffix that is compatible with '--backup=numbered' option in GNU cp is added to the new files or directories. Only file modes are preserved and all other attributes are ignored including ownership, timestamps, context, links, and xattr. Special files such as character and block devices, named pipes, and sockets are skipped and links are followed. Moving is performed using the rename operation of the underlying OS. This can fail to move files between different partitions when it needs to copy files. For these cases, users are expected to explicitly copy files and then delete the old ones manually. Operation errors are shown in the message line as well as the log file and they do not preemptively finish the corresponding file operation.
.PP
You can customize these operations by defining a 'paste' command. This is a special command that is called when it is defined instead of the builtin implementation. The default behavior is similar to the following command:
File operations can be performed on the current selected file or alternatively on multiple files by marking them first. When you 'copy' a file, lf doesn't actually copy the file on the disk, but only records its name to memory. The actual file copying takes place when you 'paste'. Similarly 'paste' after a 'cut' operation moves the file.
.PP
You can customize copy and move operations by defining a 'paste' command. This is a special command that is called when it is defined instead of the builtin implementation. You can use the following example as a starting point:
.PP
.EX
cmd paste %{{
@ -540,16 +542,16 @@ You can customize these operations by defining a 'paste' command. This is a spec
mode=$(echo "$load" | sed -n '1p')
list=$(echo "$load" | sed '1d')
if [ $mode = 'copy' ]; then
cp -R -n $list .
cp -R $list .
elif [ $mode = 'move' ]; then
mv -n $list .
mv $list .
fi
lf -remote 'send load'
lf -remote 'send clear'
}}
.EE
.PP
Some useful things are to use the backup option ('--backup') with 'cp' and 'mv' commands if they support it (i.e. GNU implementation), change the command type to asynchronous, or use 'rsync' command with progress bar option for copying and feed the progress to the client periodically with remote 'echo' calls.
Some useful things to be considered are to use the backup ('--backup') and/or preserve attributes ('-a') options with 'cp' and 'mv' commands if they support it (i.e. GNU implementation), change the command type to asynchronous, or use 'rsync' command with progress bar option for copying and feed the progress to the client periodically with remote 'echo' calls.
.PP
By default, lf does not assign 'delete' command to a key to protect new users. You can customize file deletion by defining a 'delete' command. You can also assign a key to this command if you like. An example command to move selected files to a trash folder and remove files completely after a prompt are provided in the example configuration file.
.SH SEARCHING FILES