update doc
This commit is contained in:
parent
4a8943b6b7
commit
31945fbcb5
237
doc.go
237
doc.go
@ -16,117 +16,117 @@ Reference
|
|||||||
|
|
||||||
The following commands are provided by lf with default keybindings:
|
The following commands are provided by lf with default keybindings:
|
||||||
|
|
||||||
up (default 'k' and '<up>')
|
up (default 'k' and '<up>')
|
||||||
half-up (default '<c-u>')
|
half-up (default '<c-u>')
|
||||||
page-up (default '<c-b>' and '<pgup>')
|
page-up (default '<c-b>' and '<pgup>')
|
||||||
down (default 'j' and '<down>')
|
down (default 'j' and '<down>')
|
||||||
half-down (default '<c-d>')
|
half-down (default '<c-d>')
|
||||||
page-down (default '<c-f>' and '<pgdn>')
|
page-down (default '<c-f>' and '<pgdn>')
|
||||||
updir (default 'h' and '<left>')
|
updir (default 'h' and '<left>')
|
||||||
open (default 'l' and '<right>')
|
open (default 'l' and '<right>')
|
||||||
quit (default 'q')
|
quit (default 'q')
|
||||||
top (default 'gg' and '<home>')
|
top (default 'gg' and '<home>')
|
||||||
bottom (default 'G' and '<end>')
|
bottom (default 'G' and '<end>')
|
||||||
toggle (default '<space>')
|
toggle (default '<space>')
|
||||||
invert (default 'v')
|
invert (default 'v')
|
||||||
unselect (default 'u')
|
unselect (default 'u')
|
||||||
copy (default 'y')
|
copy (default 'y')
|
||||||
cut (default 'd')
|
cut (default 'd')
|
||||||
paste (default 'p')
|
paste (default 'p')
|
||||||
clear (default 'c')
|
clear (default 'c')
|
||||||
redraw (default '<c-l>')
|
redraw (default '<c-l>')
|
||||||
reload (default '<c-r>')
|
reload (default '<c-r>')
|
||||||
read (default ':')
|
read (default ':')
|
||||||
shell (default '$')
|
shell (default '$')
|
||||||
shell-pipe (default '%')
|
shell-pipe (default '%')
|
||||||
shell-wait (default '!')
|
shell-wait (default '!')
|
||||||
shell-async (default '&')
|
shell-async (default '&')
|
||||||
find (default 'f')
|
find (default 'f')
|
||||||
find-back (default 'F')
|
find-back (default 'F')
|
||||||
find-next (default ';')
|
find-next (default ';')
|
||||||
find-prev (default ',')
|
find-prev (default ',')
|
||||||
search (default '/')
|
search (default '/')
|
||||||
search-back (default '?')
|
search-back (default '?')
|
||||||
search-next (default 'n')
|
search-next (default 'n')
|
||||||
search-prev (default 'N')
|
search-prev (default 'N')
|
||||||
mark-save (default 'm')
|
mark-save (default 'm')
|
||||||
mark-load (default "'")
|
mark-load (default "'")
|
||||||
|
|
||||||
The following commands are provided by lf without default keybindings:
|
The following commands are provided by lf without default keybindings:
|
||||||
|
|
||||||
draw draw the ui
|
draw draw the ui
|
||||||
load load modified files and directories
|
load load modified files and directories
|
||||||
sync synchronizes copied/cut files with server
|
sync synchronize copied/cut files with server
|
||||||
echo prints its arguments to the message line
|
echo print arguments to the message line
|
||||||
echomsg same as echo but logging
|
echomsg same as echo but logging
|
||||||
echoerr same as echomsg but red color
|
echoerr same as echomsg but red color
|
||||||
cd changes working directory to its argument
|
cd change working directory to the argument
|
||||||
select changes current file selection to its argument
|
select change current file selection to the argument
|
||||||
source reads the configuration file in its argument
|
source read the configuration file in the argument
|
||||||
push simulates key pushes given in its argument
|
push simulate key pushes given in the argument
|
||||||
delete deletes the current file or selected file(s)
|
delete remove the current file or selected file(s)
|
||||||
|
|
||||||
The following command line commands are provided by lf with default
|
The following command line commands are provided by lf with default
|
||||||
keybindings:
|
keybindings:
|
||||||
|
|
||||||
cmd-escape (default '<esc>')
|
cmd-escape (default '<esc>')
|
||||||
cmd-complete (default '<tab>')
|
cmd-complete (default '<tab>')
|
||||||
cmd-enter (default '<c-j>' and '<enter>')
|
cmd-enter (default '<c-j>' and '<enter>')
|
||||||
cmd-history-next (default '<c-n>')
|
cmd-history-next (default '<c-n>')
|
||||||
cmd-history-prev (default '<c-p>')
|
cmd-history-prev (default '<c-p>')
|
||||||
cmd-delete (default '<c-d>' and '<delete>')
|
cmd-delete (default '<c-d>' and '<delete>')
|
||||||
cmd-delete-back (default '<bs>' and '<bs2>')
|
cmd-delete-back (default '<bs>' and '<bs2>')
|
||||||
cmd-left (default '<c-b>' and '<left>')
|
cmd-left (default '<c-b>' and '<left>')
|
||||||
cmd-right (default '<c-f>' and '<right>')
|
cmd-right (default '<c-f>' and '<right>')
|
||||||
cmd-home (default '<c-a>' and '<home>')
|
cmd-home (default '<c-a>' and '<home>')
|
||||||
cmd-end (default '<c-e>' and '<end>')
|
cmd-end (default '<c-e>' and '<end>')
|
||||||
cmd-delete-home (default '<c-u>')
|
cmd-delete-home (default '<c-u>')
|
||||||
cmd-delete-end (default '<c-k>')
|
cmd-delete-end (default '<c-k>')
|
||||||
cmd-delete-unix-word (default '<c-w>')
|
cmd-delete-unix-word (default '<c-w>')
|
||||||
cmd-yank (default '<c-y>')
|
cmd-yank (default '<c-y>')
|
||||||
cmd-transpose (default '<c-t>')
|
cmd-transpose (default '<c-t>')
|
||||||
cmd-interrupt (default '<c-c>')
|
cmd-interrupt (default '<c-c>')
|
||||||
cmd-word (default '<a-f>')
|
cmd-word (default '<a-f>')
|
||||||
cmd-word-back (default '<a-b>')
|
cmd-word-back (default '<a-b>')
|
||||||
cmd-capitalize-word (default '<a-c>')
|
cmd-capitalize-word (default '<a-c>')
|
||||||
cmd-delete-word (default '<a-d>')
|
cmd-delete-word (default '<a-d>')
|
||||||
cmd-uppercase-word (default '<a-u>')
|
cmd-uppercase-word (default '<a-u>')
|
||||||
cmd-lowercase-word (default '<a-l>')
|
cmd-lowercase-word (default '<a-l>')
|
||||||
cmd-transpose-word (default '<a-t>')
|
cmd-transpose-word (default '<a-t>')
|
||||||
|
|
||||||
The following options can be used to customize the behavior of lf:
|
The following options can be used to customize the behavior of lf:
|
||||||
|
|
||||||
anchorfind boolean (default on)
|
anchorfind boolean (default on)
|
||||||
color256 boolean (default off)
|
color256 boolean (default off)
|
||||||
dircounts boolean (default off)
|
dircounts boolean (default off)
|
||||||
dirfirst boolean (default on)
|
dirfirst boolean (default on)
|
||||||
drawbox boolean (default off)
|
drawbox boolean (default off)
|
||||||
globsearch boolean (default off)
|
globsearch boolean (default off)
|
||||||
hidden boolean (default off)
|
hidden boolean (default off)
|
||||||
ignorecase boolean (default on)
|
ignorecase boolean (default on)
|
||||||
ignoredia boolean (default off)
|
ignoredia boolean (default off)
|
||||||
incsearch boolean (default off)
|
incsearch boolean (default off)
|
||||||
preview boolean (default on)
|
preview boolean (default on)
|
||||||
reverse boolean (default off)
|
reverse boolean (default off)
|
||||||
smartcase boolean (default on)
|
smartcase boolean (default on)
|
||||||
smartdia boolean (default off)
|
smartdia boolean (default off)
|
||||||
wrapscan boolean (default on)
|
wrapscan boolean (default on)
|
||||||
number boolean (default off)
|
number boolean (default off)
|
||||||
relativenumber boolean (default off)
|
relativenumber boolean (default off)
|
||||||
findlen integer (default 1) (zero to prompt until single match)
|
findlen integer (default 1) (zero to prompt until single match)
|
||||||
period integer (default 0) (zero to disable periodic loading)
|
period integer (default 0) (zero to disable periodic loading)
|
||||||
scrolloff integer (default 0)
|
scrolloff integer (default 0)
|
||||||
tabstop integer (default 8)
|
tabstop integer (default 8)
|
||||||
filesep string (default "\n")
|
filesep string (default "\n")
|
||||||
ifs string (default '') (not exported if empty)
|
ifs string (default '') (not exported if empty)
|
||||||
previewer string (default '') (not filtered 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")
|
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')
|
shell string (default 'sh')
|
||||||
sortby string (default 'natural')
|
sortby string (default 'natural')
|
||||||
timefmt string (default 'Mon Jan _2 15:04:05 2006')
|
timefmt string (default 'Mon Jan _2 15:04:05 2006')
|
||||||
ratios string (default '1:2:3')
|
ratios string (default '1:2:3')
|
||||||
info string (default '')
|
info string (default '')
|
||||||
shellopts string (default '')
|
shellopts string (default '')
|
||||||
|
|
||||||
The following variables are exported for shell commands:
|
The following variables are exported for shell commands:
|
||||||
|
|
||||||
@ -519,33 +519,48 @@ should not be needed for users.
|
|||||||
|
|
||||||
File Operations
|
File Operations
|
||||||
|
|
||||||
lf uses the underlying 'cp' and 'mv' shell commands for file operations. For
|
lf uses its own builtin copy and move operations by default. These are
|
||||||
this purpose, when you 'copy' a file, it doesn't actually copy the file on the
|
implemented as asynchronous operations and progress is shown in the bottom
|
||||||
disk, but only records its name to memory. The actual file operation takes
|
ruler. These commands do not overwrite existing files or directories with the
|
||||||
place when you 'paste' in which case the 'cp' command is used. Similarly the
|
same name. Instead, a suffix that is compatible with '--backup=numbered' option
|
||||||
'mv' command is used for 'cut' followed by 'paste'.
|
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
|
File operations can be performed on the current selected file or alternatively
|
||||||
special command that is called when it is defined instead of the builtin
|
on multiple files by marking them first. When you 'copy' a file, lf doesn't
|
||||||
implementation. The default behavior is similar to the following command:
|
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 %{{
|
cmd paste %{{
|
||||||
load=$(lf -remote 'load')
|
load=$(lf -remote 'load')
|
||||||
mode=$(echo "$load" | sed -n '1p')
|
mode=$(echo "$load" | sed -n '1p')
|
||||||
list=$(echo "$load" | sed '1d')
|
list=$(echo "$load" | sed '1d')
|
||||||
if [ $mode = 'copy' ]; then
|
if [ $mode = 'copy' ]; then
|
||||||
cp -R -n $list .
|
cp -R $list .
|
||||||
elif [ $mode = 'move' ]; then
|
elif [ $mode = 'move' ]; then
|
||||||
mv -n $list .
|
mv $list .
|
||||||
fi
|
fi
|
||||||
lf -remote 'send load'
|
lf -remote 'send load'
|
||||||
lf -remote 'send clear'
|
lf -remote 'send clear'
|
||||||
}}
|
}}
|
||||||
|
|
||||||
Some useful things are to use the backup option ('--backup') with 'cp' and 'mv'
|
Some useful things to be considered are to use the backup ('--backup') and/or
|
||||||
commands if they support it (i.e. GNU implementation), change the command type
|
preserve attributes ('-a') options with 'cp' and 'mv' commands if they support
|
||||||
to asynchronous, or use 'rsync' command with progress bar option for copying
|
it (i.e. GNU implementation), change the command type to asynchronous, or use
|
||||||
and feed the progress to the client periodically with remote 'echo' calls.
|
'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.
|
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
|
You can customize file deletion by defining a 'delete' command. You can also
|
||||||
|
240
docstring.go
240
docstring.go
@ -19,117 +19,117 @@ Reference
|
|||||||
|
|
||||||
The following commands are provided by lf with default keybindings:
|
The following commands are provided by lf with default keybindings:
|
||||||
|
|
||||||
up (default 'k' and '<up>')
|
up (default 'k' and '<up>')
|
||||||
half-up (default '<c-u>')
|
half-up (default '<c-u>')
|
||||||
page-up (default '<c-b>' and '<pgup>')
|
page-up (default '<c-b>' and '<pgup>')
|
||||||
down (default 'j' and '<down>')
|
down (default 'j' and '<down>')
|
||||||
half-down (default '<c-d>')
|
half-down (default '<c-d>')
|
||||||
page-down (default '<c-f>' and '<pgdn>')
|
page-down (default '<c-f>' and '<pgdn>')
|
||||||
updir (default 'h' and '<left>')
|
updir (default 'h' and '<left>')
|
||||||
open (default 'l' and '<right>')
|
open (default 'l' and '<right>')
|
||||||
quit (default 'q')
|
quit (default 'q')
|
||||||
top (default 'gg' and '<home>')
|
top (default 'gg' and '<home>')
|
||||||
bottom (default 'G' and '<end>')
|
bottom (default 'G' and '<end>')
|
||||||
toggle (default '<space>')
|
toggle (default '<space>')
|
||||||
invert (default 'v')
|
invert (default 'v')
|
||||||
unselect (default 'u')
|
unselect (default 'u')
|
||||||
copy (default 'y')
|
copy (default 'y')
|
||||||
cut (default 'd')
|
cut (default 'd')
|
||||||
paste (default 'p')
|
paste (default 'p')
|
||||||
clear (default 'c')
|
clear (default 'c')
|
||||||
redraw (default '<c-l>')
|
redraw (default '<c-l>')
|
||||||
reload (default '<c-r>')
|
reload (default '<c-r>')
|
||||||
read (default ':')
|
read (default ':')
|
||||||
shell (default '$')
|
shell (default '$')
|
||||||
shell-pipe (default '%')
|
shell-pipe (default '%')
|
||||||
shell-wait (default '!')
|
shell-wait (default '!')
|
||||||
shell-async (default '&')
|
shell-async (default '&')
|
||||||
find (default 'f')
|
find (default 'f')
|
||||||
find-back (default 'F')
|
find-back (default 'F')
|
||||||
find-next (default ';')
|
find-next (default ';')
|
||||||
find-prev (default ',')
|
find-prev (default ',')
|
||||||
search (default '/')
|
search (default '/')
|
||||||
search-back (default '?')
|
search-back (default '?')
|
||||||
search-next (default 'n')
|
search-next (default 'n')
|
||||||
search-prev (default 'N')
|
search-prev (default 'N')
|
||||||
mark-save (default 'm')
|
mark-save (default 'm')
|
||||||
mark-load (default "'")
|
mark-load (default "'")
|
||||||
|
|
||||||
The following commands are provided by lf without default keybindings:
|
The following commands are provided by lf without default keybindings:
|
||||||
|
|
||||||
draw draw the ui
|
draw draw the ui
|
||||||
load load modified files and directories
|
load load modified files and directories
|
||||||
sync synchronizes copied/cut files with server
|
sync synchronize copied/cut files with server
|
||||||
echo prints its arguments to the message line
|
echo print arguments to the message line
|
||||||
echomsg same as echo but logging
|
echomsg same as echo but logging
|
||||||
echoerr same as echomsg but red color
|
echoerr same as echomsg but red color
|
||||||
cd changes working directory to its argument
|
cd change working directory to the argument
|
||||||
select changes current file selection to its argument
|
select change current file selection to the argument
|
||||||
source reads the configuration file in its argument
|
source read the configuration file in the argument
|
||||||
push simulates key pushes given in its argument
|
push simulate key pushes given in the argument
|
||||||
delete deletes the current file or selected file(s)
|
delete remove the current file or selected file(s)
|
||||||
|
|
||||||
The following command line commands are provided by lf with default
|
The following command line commands are provided by lf with default
|
||||||
keybindings:
|
keybindings:
|
||||||
|
|
||||||
cmd-escape (default '<esc>')
|
cmd-escape (default '<esc>')
|
||||||
cmd-complete (default '<tab>')
|
cmd-complete (default '<tab>')
|
||||||
cmd-enter (default '<c-j>' and '<enter>')
|
cmd-enter (default '<c-j>' and '<enter>')
|
||||||
cmd-history-next (default '<c-n>')
|
cmd-history-next (default '<c-n>')
|
||||||
cmd-history-prev (default '<c-p>')
|
cmd-history-prev (default '<c-p>')
|
||||||
cmd-delete (default '<c-d>' and '<delete>')
|
cmd-delete (default '<c-d>' and '<delete>')
|
||||||
cmd-delete-back (default '<bs>' and '<bs2>')
|
cmd-delete-back (default '<bs>' and '<bs2>')
|
||||||
cmd-left (default '<c-b>' and '<left>')
|
cmd-left (default '<c-b>' and '<left>')
|
||||||
cmd-right (default '<c-f>' and '<right>')
|
cmd-right (default '<c-f>' and '<right>')
|
||||||
cmd-home (default '<c-a>' and '<home>')
|
cmd-home (default '<c-a>' and '<home>')
|
||||||
cmd-end (default '<c-e>' and '<end>')
|
cmd-end (default '<c-e>' and '<end>')
|
||||||
cmd-delete-home (default '<c-u>')
|
cmd-delete-home (default '<c-u>')
|
||||||
cmd-delete-end (default '<c-k>')
|
cmd-delete-end (default '<c-k>')
|
||||||
cmd-delete-unix-word (default '<c-w>')
|
cmd-delete-unix-word (default '<c-w>')
|
||||||
cmd-yank (default '<c-y>')
|
cmd-yank (default '<c-y>')
|
||||||
cmd-transpose (default '<c-t>')
|
cmd-transpose (default '<c-t>')
|
||||||
cmd-interrupt (default '<c-c>')
|
cmd-interrupt (default '<c-c>')
|
||||||
cmd-word (default '<a-f>')
|
cmd-word (default '<a-f>')
|
||||||
cmd-word-back (default '<a-b>')
|
cmd-word-back (default '<a-b>')
|
||||||
cmd-capitalize-word (default '<a-c>')
|
cmd-capitalize-word (default '<a-c>')
|
||||||
cmd-delete-word (default '<a-d>')
|
cmd-delete-word (default '<a-d>')
|
||||||
cmd-uppercase-word (default '<a-u>')
|
cmd-uppercase-word (default '<a-u>')
|
||||||
cmd-lowercase-word (default '<a-l>')
|
cmd-lowercase-word (default '<a-l>')
|
||||||
cmd-transpose-word (default '<a-t>')
|
cmd-transpose-word (default '<a-t>')
|
||||||
|
|
||||||
The following options can be used to customize the behavior of lf:
|
The following options can be used to customize the behavior of lf:
|
||||||
|
|
||||||
anchorfind boolean (default on)
|
anchorfind boolean (default on)
|
||||||
color256 boolean (default off)
|
color256 boolean (default off)
|
||||||
dircounts boolean (default off)
|
dircounts boolean (default off)
|
||||||
dirfirst boolean (default on)
|
dirfirst boolean (default on)
|
||||||
drawbox boolean (default off)
|
drawbox boolean (default off)
|
||||||
globsearch boolean (default off)
|
globsearch boolean (default off)
|
||||||
hidden boolean (default off)
|
hidden boolean (default off)
|
||||||
ignorecase boolean (default on)
|
ignorecase boolean (default on)
|
||||||
ignoredia boolean (default off)
|
ignoredia boolean (default off)
|
||||||
incsearch boolean (default off)
|
incsearch boolean (default off)
|
||||||
preview boolean (default on)
|
preview boolean (default on)
|
||||||
reverse boolean (default off)
|
reverse boolean (default off)
|
||||||
smartcase boolean (default on)
|
smartcase boolean (default on)
|
||||||
smartdia boolean (default off)
|
smartdia boolean (default off)
|
||||||
wrapscan boolean (default on)
|
wrapscan boolean (default on)
|
||||||
number boolean (default off)
|
number boolean (default off)
|
||||||
relativenumber boolean (default off)
|
relativenumber boolean (default off)
|
||||||
findlen integer (default 1) (zero to prompt until single match)
|
findlen integer (default 1) (zero to prompt until single match)
|
||||||
period integer (default 0) (zero to disable periodic loading)
|
period integer (default 0) (zero to disable periodic loading)
|
||||||
scrolloff integer (default 0)
|
scrolloff integer (default 0)
|
||||||
tabstop integer (default 8)
|
tabstop integer (default 8)
|
||||||
filesep string (default "\n")
|
filesep string (default "\n")
|
||||||
ifs string (default '') (not exported if empty)
|
ifs string (default ”) (not exported if empty)
|
||||||
previewer string (default '') (not filtered 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")
|
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')
|
shell string (default 'sh')
|
||||||
sortby string (default 'natural')
|
sortby string (default 'natural')
|
||||||
timefmt string (default 'Mon Jan _2 15:04:05 2006')
|
timefmt string (default 'Mon Jan _2 15:04:05 2006')
|
||||||
ratios string (default '1:2:3')
|
ratios string (default '1:2:3')
|
||||||
info string (default '')
|
info string (default ”)
|
||||||
shellopts string (default '')
|
shellopts string (default ”)
|
||||||
|
|
||||||
The following variables are exported for shell commands:
|
The following variables are exported for shell commands:
|
||||||
|
|
||||||
@ -541,34 +541,50 @@ should not be needed for users.
|
|||||||
|
|
||||||
File Operations
|
File Operations
|
||||||
|
|
||||||
lf uses the underlying 'cp' and 'mv' shell commands for file operations. For
|
lf uses its own builtin copy and move operations by default. These are
|
||||||
this purpose, when you 'copy' a file, it doesn't actually copy the file on
|
implemented as asynchronous operations and progress is shown in the bottom
|
||||||
the disk, but only records its name to memory. The actual file operation
|
ruler. These commands do not overwrite existing files or directories with
|
||||||
takes place when you 'paste' in which case the 'cp' command is used.
|
the same name. Instead, a suffix that is compatible with '--backup=numbered'
|
||||||
Similarly the 'mv' command is used for 'cut' followed by 'paste'.
|
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
|
File operations can be performed on the current selected file or
|
||||||
special command that is called when it is defined instead of the builtin
|
alternatively on multiple files by marking them first. When you 'copy' a
|
||||||
implementation. The default behavior is similar to the following command:
|
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 %{{
|
cmd paste %{{
|
||||||
load=$(lf -remote 'load')
|
load=$(lf -remote 'load')
|
||||||
mode=$(echo "$load" | sed -n '1p')
|
mode=$(echo "$load" | sed -n '1p')
|
||||||
list=$(echo "$load" | sed '1d')
|
list=$(echo "$load" | sed '1d')
|
||||||
if [ $mode = 'copy' ]; then
|
if [ $mode = 'copy' ]; then
|
||||||
cp -R -n $list .
|
cp -R $list .
|
||||||
elif [ $mode = 'move' ]; then
|
elif [ $mode = 'move' ]; then
|
||||||
mv -n $list .
|
mv $list .
|
||||||
fi
|
fi
|
||||||
lf -remote 'send load'
|
lf -remote 'send load'
|
||||||
lf -remote 'send clear'
|
lf -remote 'send clear'
|
||||||
}}
|
}}
|
||||||
|
|
||||||
Some useful things are to use the backup option ('--backup') with 'cp' and
|
Some useful things to be considered are to use the backup ('--backup')
|
||||||
'mv' commands if they support it (i.e. GNU implementation), change the
|
and/or preserve attributes ('-a') options with 'cp' and 'mv' commands if
|
||||||
command type to asynchronous, or use 'rsync' command with progress bar
|
they support it (i.e. GNU implementation), change the command type to
|
||||||
option for copying and feed the progress to the client periodically with
|
asynchronous, or use 'rsync' command with progress bar option for copying
|
||||||
remote 'echo' calls.
|
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
|
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
|
users. You can customize file deletion by defining a 'delete' command. You
|
||||||
|
206
lf.1
206
lf.1
@ -26,41 +26,41 @@ You can run 'lf -help' to see descriptions of command line options.
|
|||||||
The following commands are provided by lf with default keybindings:
|
The following commands are provided by lf with default keybindings:
|
||||||
.PP
|
.PP
|
||||||
.EX
|
.EX
|
||||||
up (default 'k' and '<up>')
|
up (default 'k' and '<up>')
|
||||||
half-up (default '<c-u>')
|
half-up (default '<c-u>')
|
||||||
page-up (default '<c-b>' and '<pgup>')
|
page-up (default '<c-b>' and '<pgup>')
|
||||||
down (default 'j' and '<down>')
|
down (default 'j' and '<down>')
|
||||||
half-down (default '<c-d>')
|
half-down (default '<c-d>')
|
||||||
page-down (default '<c-f>' and '<pgdn>')
|
page-down (default '<c-f>' and '<pgdn>')
|
||||||
updir (default 'h' and '<left>')
|
updir (default 'h' and '<left>')
|
||||||
open (default 'l' and '<right>')
|
open (default 'l' and '<right>')
|
||||||
quit (default 'q')
|
quit (default 'q')
|
||||||
top (default 'gg' and '<home>')
|
top (default 'gg' and '<home>')
|
||||||
bottom (default 'G' and '<end>')
|
bottom (default 'G' and '<end>')
|
||||||
toggle (default '<space>')
|
toggle (default '<space>')
|
||||||
invert (default 'v')
|
invert (default 'v')
|
||||||
unselect (default 'u')
|
unselect (default 'u')
|
||||||
copy (default 'y')
|
copy (default 'y')
|
||||||
cut (default 'd')
|
cut (default 'd')
|
||||||
paste (default 'p')
|
paste (default 'p')
|
||||||
clear (default 'c')
|
clear (default 'c')
|
||||||
redraw (default '<c-l>')
|
redraw (default '<c-l>')
|
||||||
reload (default '<c-r>')
|
reload (default '<c-r>')
|
||||||
read (default ':')
|
read (default ':')
|
||||||
shell (default '$')
|
shell (default '$')
|
||||||
shell-pipe (default '%')
|
shell-pipe (default '%')
|
||||||
shell-wait (default '!')
|
shell-wait (default '!')
|
||||||
shell-async (default '&')
|
shell-async (default '&')
|
||||||
find (default 'f')
|
find (default 'f')
|
||||||
find-back (default 'F')
|
find-back (default 'F')
|
||||||
find-next (default ';')
|
find-next (default ';')
|
||||||
find-prev (default ',')
|
find-prev (default ',')
|
||||||
search (default '/')
|
search (default '/')
|
||||||
search-back (default '?')
|
search-back (default '?')
|
||||||
search-next (default 'n')
|
search-next (default 'n')
|
||||||
search-prev (default 'N')
|
search-prev (default 'N')
|
||||||
mark-save (default 'm')
|
mark-save (default 'm')
|
||||||
mark-load (default "'")
|
mark-load (default "'")
|
||||||
.EE
|
.EE
|
||||||
.PP
|
.PP
|
||||||
The following commands are provided by lf without default keybindings:
|
The following commands are provided by lf without default keybindings:
|
||||||
@ -68,80 +68,80 @@ The following commands are provided by lf without default keybindings:
|
|||||||
.EX
|
.EX
|
||||||
draw draw the ui
|
draw draw the ui
|
||||||
load load modified files and directories
|
load load modified files and directories
|
||||||
sync synchronizes copied/cut files with server
|
sync synchronize copied/cut files with server
|
||||||
echo prints its arguments to the message line
|
echo print arguments to the message line
|
||||||
echomsg same as echo but logging
|
echomsg same as echo but logging
|
||||||
echoerr same as echomsg but red color
|
echoerr same as echomsg but red color
|
||||||
cd changes working directory to its argument
|
cd change working directory to the argument
|
||||||
select changes current file selection to its argument
|
select change current file selection to the argument
|
||||||
source reads the configuration file in its argument
|
source read the configuration file in the argument
|
||||||
push simulates key pushes given in its argument
|
push simulate key pushes given in the argument
|
||||||
delete deletes the current file or selected file(s)
|
delete remove the current file or selected file(s)
|
||||||
.EE
|
.EE
|
||||||
.PP
|
.PP
|
||||||
The following command line commands are provided by lf with default keybindings:
|
The following command line commands are provided by lf with default keybindings:
|
||||||
.PP
|
.PP
|
||||||
.EX
|
.EX
|
||||||
cmd-escape (default '<esc>')
|
cmd-escape (default '<esc>')
|
||||||
cmd-complete (default '<tab>')
|
cmd-complete (default '<tab>')
|
||||||
cmd-enter (default '<c-j>' and '<enter>')
|
cmd-enter (default '<c-j>' and '<enter>')
|
||||||
cmd-history-next (default '<c-n>')
|
cmd-history-next (default '<c-n>')
|
||||||
cmd-history-prev (default '<c-p>')
|
cmd-history-prev (default '<c-p>')
|
||||||
cmd-delete (default '<c-d>' and '<delete>')
|
cmd-delete (default '<c-d>' and '<delete>')
|
||||||
cmd-delete-back (default '<bs>' and '<bs2>')
|
cmd-delete-back (default '<bs>' and '<bs2>')
|
||||||
cmd-left (default '<c-b>' and '<left>')
|
cmd-left (default '<c-b>' and '<left>')
|
||||||
cmd-right (default '<c-f>' and '<right>')
|
cmd-right (default '<c-f>' and '<right>')
|
||||||
cmd-home (default '<c-a>' and '<home>')
|
cmd-home (default '<c-a>' and '<home>')
|
||||||
cmd-end (default '<c-e>' and '<end>')
|
cmd-end (default '<c-e>' and '<end>')
|
||||||
cmd-delete-home (default '<c-u>')
|
cmd-delete-home (default '<c-u>')
|
||||||
cmd-delete-end (default '<c-k>')
|
cmd-delete-end (default '<c-k>')
|
||||||
cmd-delete-unix-word (default '<c-w>')
|
cmd-delete-unix-word (default '<c-w>')
|
||||||
cmd-yank (default '<c-y>')
|
cmd-yank (default '<c-y>')
|
||||||
cmd-transpose (default '<c-t>')
|
cmd-transpose (default '<c-t>')
|
||||||
cmd-interrupt (default '<c-c>')
|
cmd-interrupt (default '<c-c>')
|
||||||
cmd-word (default '<a-f>')
|
cmd-word (default '<a-f>')
|
||||||
cmd-word-back (default '<a-b>')
|
cmd-word-back (default '<a-b>')
|
||||||
cmd-capitalize-word (default '<a-c>')
|
cmd-capitalize-word (default '<a-c>')
|
||||||
cmd-delete-word (default '<a-d>')
|
cmd-delete-word (default '<a-d>')
|
||||||
cmd-uppercase-word (default '<a-u>')
|
cmd-uppercase-word (default '<a-u>')
|
||||||
cmd-lowercase-word (default '<a-l>')
|
cmd-lowercase-word (default '<a-l>')
|
||||||
cmd-transpose-word (default '<a-t>')
|
cmd-transpose-word (default '<a-t>')
|
||||||
.EE
|
.EE
|
||||||
.PP
|
.PP
|
||||||
The following options can be used to customize the behavior of lf:
|
The following options can be used to customize the behavior of lf:
|
||||||
.PP
|
.PP
|
||||||
.EX
|
.EX
|
||||||
anchorfind boolean (default on)
|
anchorfind boolean (default on)
|
||||||
color256 boolean (default off)
|
color256 boolean (default off)
|
||||||
dircounts boolean (default off)
|
dircounts boolean (default off)
|
||||||
dirfirst boolean (default on)
|
dirfirst boolean (default on)
|
||||||
drawbox boolean (default off)
|
drawbox boolean (default off)
|
||||||
globsearch boolean (default off)
|
globsearch boolean (default off)
|
||||||
hidden boolean (default off)
|
hidden boolean (default off)
|
||||||
ignorecase boolean (default on)
|
ignorecase boolean (default on)
|
||||||
ignoredia boolean (default off)
|
ignoredia boolean (default off)
|
||||||
incsearch boolean (default off)
|
incsearch boolean (default off)
|
||||||
preview boolean (default on)
|
preview boolean (default on)
|
||||||
reverse boolean (default off)
|
reverse boolean (default off)
|
||||||
smartcase boolean (default on)
|
smartcase boolean (default on)
|
||||||
smartdia boolean (default off)
|
smartdia boolean (default off)
|
||||||
wrapscan boolean (default on)
|
wrapscan boolean (default on)
|
||||||
number boolean (default off)
|
number boolean (default off)
|
||||||
relativenumber boolean (default off)
|
relativenumber boolean (default off)
|
||||||
findlen integer (default 1) (zero to prompt until single match)
|
findlen integer (default 1) (zero to prompt until single match)
|
||||||
period integer (default 0) (zero to disable periodic loading)
|
period integer (default 0) (zero to disable periodic loading)
|
||||||
scrolloff integer (default 0)
|
scrolloff integer (default 0)
|
||||||
tabstop integer (default 8)
|
tabstop integer (default 8)
|
||||||
filesep string (default "\en")
|
filesep string (default "\en")
|
||||||
ifs string (default '') (not exported if empty)
|
ifs string (default ”) (not exported if empty)
|
||||||
previewer string (default '') (not filtered 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")
|
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')
|
shell string (default 'sh')
|
||||||
sortby string (default 'natural')
|
sortby string (default 'natural')
|
||||||
timefmt string (default 'Mon Jan _2 15:04:05 2006')
|
timefmt string (default 'Mon Jan _2 15:04:05 2006')
|
||||||
ratios string (default '1:2:3')
|
ratios string (default '1:2:3')
|
||||||
info string (default '')
|
info string (default ”)
|
||||||
shellopts string (default '')
|
shellopts string (default ”)
|
||||||
.EE
|
.EE
|
||||||
.PP
|
.PP
|
||||||
The following variables are exported for shell commands:
|
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
|
.PP
|
||||||
Lastly, there is a 'conn' command to connect the server as a client. This should not be needed for users.
|
Lastly, there is a 'conn' command to connect the server as a client. This should not be needed for users.
|
||||||
.SH FILE OPERATIONS
|
.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
|
.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
|
.PP
|
||||||
.EX
|
.EX
|
||||||
cmd paste %{{
|
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')
|
mode=$(echo "$load" | sed -n '1p')
|
||||||
list=$(echo "$load" | sed '1d')
|
list=$(echo "$load" | sed '1d')
|
||||||
if [ $mode = 'copy' ]; then
|
if [ $mode = 'copy' ]; then
|
||||||
cp -R -n $list .
|
cp -R $list .
|
||||||
elif [ $mode = 'move' ]; then
|
elif [ $mode = 'move' ]; then
|
||||||
mv -n $list .
|
mv $list .
|
||||||
fi
|
fi
|
||||||
lf -remote 'send load'
|
lf -remote 'send load'
|
||||||
lf -remote 'send clear'
|
lf -remote 'send clear'
|
||||||
}}
|
}}
|
||||||
.EE
|
.EE
|
||||||
.PP
|
.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
|
.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.
|
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
|
.SH SEARCHING FILES
|
||||||
|
Loading…
Reference in New Issue
Block a user