LF(1) DOCUMENTATION LF(1) (NAME) lf - (SYNOPSIS) lf [-command command] [-config path] [-cpuprofile path] [-doc] [-help] [-last-dir-path path] [-log path] [-memprofile path] [-print-last-dir] [-print-selection] [-remote command] [-selection-path path] [-server] [-single] [-version] [cd-or-select-path] (DESCRIPTION) lf . : lf -doc : help ( ) lf (pager) . (man page) : (OPTIONS) (POSITIONAL ARGUMENTS) cd-or-select-path . path . . path lf . . (META OPTIONS) -doc lf ( ) . -help . -version . (STARTUP & CONFIGURATION) -command command command ( on-init). -command <<;>> . -config path path . lfrc . (SHELL INTEGRATION) -print-last-dir (stdout) lf. lf . CHANGING DIRECTORY . -last-dir-path path -print-last-dir path . -print-selection lf. lf (open file) . . . lf . lf . -selection-path path -print-selection path . (SERVER) -remote command command ( send query list quit quit!). REMOTE COMMANDS . -server ( ). ( -log) . -single . -single . (remote control) . (DIAGNOSTICS) -log path path. -cpuprofile path (CPU profile) path. go tool pprof . -memprofile path (memory profile) path. go tool pprof . (EXAMPLES) lf ( ): lf -command 'set nohidden' -command 'set hiddenfiles "*mp4:*pdf:*txt"' -print-selection << >> : lf -command 'set nopreview; set ratios 1; set drawbox; set promptfmt "Select files [%w] %S q: cancel, l: confirm"' -print-selection Downloads sortby info : lf -command 'set sortby btime; set info btime' ~/Downloads lf: lf -command 'set nohistory' : lf -config /dev/null -log /tmp/lf.log : lf -remote 'quit!' lf: cd "$(lf -print-last-dir)" (QUICK REFERENCE) lf : quit (default 'q') up (default 'k' and '') half-up (default '') page-up (default '' and '') scroll-up (default '') down (default 'j' and '') half-down (default '') page-down (default '' and '') scroll-down (default '') updir (default 'h' and '') open (default 'l' and '') jump-next (default ']') jump-prev (default '[') top (default 'gg' and '') bottom (default 'G' and '') high (default 'H') middle (default 'M') low (default 'L') toggle invert (default 'v') unselect (default 'u') glob-select glob-unselect copy (default 'y') cut (default 'd') paste (default 'p') clear (default 'c') sync draw redraw (default '') load reload (default '') delete (modal) rename (modal) (default 'r') read (modal) (default ':') shell (modal) (default '$') shell-pipe (modal) (default '%') shell-wait (modal) (default '!') shell-async (modal) (default '&') find (modal) (default 'f') find-back (modal) (default 'F') find-next (default ';') find-prev (default ',') search (modal) (default '/') search-back (modal) (default '?') search-next (default 'n') search-prev (default 'N') filter (modal) setfilter mark-save (modal) (default 'm') mark-load (modal) (default "'") mark-remove (modal) (default '"') tag tag-toggle (default 't') echo echomsg echoerr cd select source push addcustominfo calcdirsize clearmaps tty-write visual (default 'V') (Visual mode) lf : visual-accept (default 'V') visual-unselect visual-discard (default '') visual-change (default 'o') (Command-line mode) lf : cmd-insert cmd-escape (default '') cmd-complete (default '') cmd-menu-complete cmd-menu-complete-back cmd-menu-accept cmd-menu-discard cmd-enter (default '' and '') cmd-interrupt (default '') cmd-history-next (default '' and '') cmd-history-prev (default '' and '') cmd-left (default '' and '') cmd-right (default '' and '') cmd-home (default '' and '') cmd-end (default '' and '') cmd-delete (default '' and '') cmd-delete-back (default '') cmd-delete-home (default '') cmd-delete-end (default '') cmd-delete-unix-word (default '') cmd-yank (default '') cmd-transpose (default '') cmd-transpose-word (default '') cmd-word (default '') cmd-word-back (default '') cmd-delete-word (default '') cmd-delete-word-back (default '') cmd-capitalize-word (default '') cmd-uppercase-word (default '') cmd-lowercase-word (default '') lf : anchorfind bool (default true) autoquit bool (default true) borderfmt string (default "\033[0m") borderstyle string (default 'box') cleaner string (default '') copyfmt string (default "\033[7;33m") cursoractivefmt string (default "\033[7m") cursorparentfmt string (default "\033[7m") cursorpreviewfmt string (default "\033[4m") cutfmt string (default "\033[7;31m") dircounts bool (default false) dirfirst bool (default true) dironly bool (default false) dirpreviews bool (default false) drawbox bool (default false) dupfilefmt string (default '%f.~%n~') errorfmt string (default "\033[7;31;47m") filesep string (default "\n") filtermethod string (default 'text') findlen int (default 1) hidden bool (default false) hiddenfiles []string (default '.*' for Unix and '' for Windows) history bool (default true) icons bool (default false) ifs string (default '') ignorecase bool (default true) ignoredia bool (default true) incfilter bool (default false) incsearch bool (default false) info []string (default '') infotimefmtnew string (default 'Jan _2 15:04') infotimefmtold string (default 'Jan _2 2006') menufmt string (default "\033[0m") menuheaderfmt string (default "\033[1m") menuselectfmt string (default "\033[7m") mergeindicators bool (default false) mouse bool (default false) number bool (default false) numbercursorfmt string (default '') numberfmt string (default "\033[33m") period int (default 0) preload bool (default false) preserve []string (default "mode") preview bool (default true) previewer string (default '') promptfmt string (default "\033[32;1m%u@%h\033[0m:\033[34;1m%d\033[0m\033[1m%f\033[0m") ratios []int (default '1:2:3') relativenumber bool (default false) reverse bool (default false) rulerfile string (default "") rulerfmt string (default "") scrolloff int (default 0) searchmethod string (default 'text') selectfmt string (default "\033[7;35m") selmode string (default 'all') shell string (default 'sh' for Unix and 'cmd' for Windows) shellflag string (default '-c' for Unix and '/c' for Windows) shellopts []string (default '') showbinds bool (default true) sizeunits string (default 'binary') smartcase bool (default true) smartdia bool (default false) sortby string (default 'natural') sortignorecase bool (default true) sortignoredia bool (default true) statfmt string (default "\033[36m%p\033[0m| %c| %u| %g| %S| %t| -> %l") tabstop int (default 8) tagfmt string (default "\033[31m") tempmarks string (default '') terminalcursor string (default 'default') timefmt string (default 'Mon Jan _2 15:04:05 2006') truncatechar string (default '~') truncatepct int (default 100) visualfmt string (default "\033[7;36m") waitmsg string (default 'Press any key to continue') watch bool (default false) wrapscan bool (default true) wrapscroll bool (default false) user_{option} string (default none) : f fs fv fx id PWD OLDPWD LF_LEVEL OPENER VISUAL EDITOR PAGER SHELL lf lf_{option} lf_user_{option} lf_flag_{flag} lf_width lf_height lf_count lf_mode lf : open paste rename delete pre-cd on-cd on-load on-focus-gained on-focus-lost on-init on-select on-redraw on-quit : Unix cmd open &$OPENER "$f" map e $$EDITOR "$f" map i $$PAGER "$f" map w $$SHELL cmd help $$lf -doc | $PAGER map help cmd maps $lf -remote "query $id maps" | $PAGER cmd nmaps $lf -remote "query $id nmaps" | $PAGER cmd vmaps $lf -remote "query $id vmaps" | $PAGER cmd cmaps $lf -remote "query $id cmaps" | $PAGER cmd cmds $lf -remote "query $id cmds" | $PAGER Windows cmd open &%OPENER% %f% map e $%EDITOR% %f% map i !%PAGER% %f% map w $%SHELL% cmd help !%lf% -doc | %PAGER% map help cmd maps !%lf% -remote "query %id% maps" | %PAGER% cmd nmaps !%lf% -remote "query %id% nmaps" | %PAGER% cmd vmaps !%lf% -remote "query %id% vmaps" | %PAGER% cmd cmaps !%lf% -remote "query %id% cmaps" | %PAGER% cmd cmds !%lf% -remote "query %id% cmds" | %PAGER% cmd . PowerShell : : map zh set hidden! map zr set reverse! map zn set info map zs set info size map zt set info time map za set info size:time map sn :set sortby natural; set info map ss :set sortby size; set info size map st :set sortby time; set info time map sa :set sortby atime; set info atime map sb :set sortby btime; set info btime map sc :set sortby ctime; set info ctime map se :set sortby ext; set info map gh cd ~ nmap :toggle; down mouse : 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 pane. Scroll wheel Move up or down. If Ctrl is pressed, scroll up or down. (CONFIGURATION) : OS system-wide user-specific Unix /etc/lf/lfrc ~/.config/lf/lfrc Windows C:\ProgramData\lf\lfrc C:\Users\\AppData\Roaming\lf\lfrc (colors) : OS system-wide user-specific Unix /etc/lf/colors ~/.config/lf/colors Windows C:\ProgramData\lf\colors C:\Users\\AppData\Roaming\lf\colors (icons) : OS system-wide user-specific Unix /etc/lf/icons ~/.config/lf/icons Windows C:\ProgramData\lf\icons C:\Users\\AppData\Roaming\lf\icons (selection) : Unix ~/.local/share/lf/files Windows C:\Users\\AppData\Local\lf\files (marks) : Unix ~/.local/share/lf/marks Windows C:\Users\\AppData\Local\lf\marks (tags) : Unix ~/.local/share/lf/tags Windows C:\Users\\AppData\Local\lf\tags (history) : Unix ~/.local/share/lf/history Windows C:\Users\\AppData\Local\lf\history : Unix $LF_CONFIG_HOME $XDG_CONFIG_HOME ~/.config $LF_DATA_HOME $XDG_DATA_HOME ~/.local/share Windows %LF_CONFIG_HOME% %XDG_CONFIG_HOME% %APPDATA% %LF_DATA_HOME% %XDG_DATA_HOME% %LOCALAPPDATA% : (COMMANDS) (built-in) . (Modal commands) . quit (default q) lf . up (default k and ), half-up (default ), page-up (default and ), scroll-up (default ), down (default j and ), half-down (default ), page-down (default and ), scroll-down (default ) . updir (default h and ) ( ). open (default l and ) open . open . open . jump-next (default ]), jump-prev (default [) (jumplist). top (default gg and ), bottom (default G and ) . 3G . high (default H), middle (default M), low (default L) . toggle . invert (default v) ( toggle ). . invert unselect ( cmd select-all :unselect; invert) . unselect (default u) . glob-select, glob-unselect . copy (default y) . . cut (default d) (Move). . paste (default p) . paste . clear (default c) . sync . . draw . . redraw (default ) . load . . reload (default ) (cache) . delete (modal) . delete . rename (modal) (default r) . rename . read (modal) (default :) . shell (modal) (default $) . shell-pipe (modal) (default %) / . shell-wait (modal) (default !) . shell-async (modal) (default &) / . find (modal) (default f), find-back (modal) (default F), find-next (default ;), find-prev (default ,) () . search (default /), search-back (default ?), search-next (default n), search-prev (default N) . filter (modal), setfilter filter . setfilter . filter . mark-save (modal) (default m) (bookmark) . mark-load (modal) (default ') . ' mark-load cd select . mark-remove (modal) (default ") . tag * . tag tag-toggle ( cmd tag-clear :tag; tag-toggle). tag-toggle (default t) * . echo . echomsg . echoerr errorfmt . cd . select . source . push . addcustominfo (custom) .Stat.CustomInfo . ANSI . . calcdirsize . info size dircounts . - . clearmaps map nmap vmap. . : read cmap lf :quit . tty-write tty. (escape sequences) ( OSC 0 ). tty-write /dev/tty . visual (default V) (Visual mode). . (VISUAL MODE COMMANDS) visual-accept (default V) . visual-unselect . visual-discard (default ) . visual-change (default o) . (COMMAND-LINE MODE COMMANDS) (prompt) . read : . : ! $ % & . cmd-delete-back ( ) . readline . . cmd-insert . . cmd-escape (default ) . cmd-complete (default ) . cmd-menu-complete, cmd-menu-complete-back . ( cmap cmd-menu-complete; cmap cmd-menu-complete-back). . cmd-menu-accept . cmd-menu-discard . cmd-enter (default and ) . cmd-interrupt (default ) . cmd-history-next (default and ), cmd-history-prev (default and ) . . cmd-left (default and ), cmd-right (default and ) . cmd-home (default and ), cmd-end (default and ) . cmd-delete (default and ) . cmd-delete-back (default ) . : . cmd-delete-home (default ), cmd-delete-end (default ) . cmd-delete-unix-word (default ) . cmd-yank (default ) (paste) . cmd-transpose (default ) . . cmd-transpose-word (default ) . . cmd-word (default ), cmd-word-back (default ) . cmd-delete-word (default ) . cmd-delete-word-back (default ) . cmd-capitalize-word (default ), cmd-uppercase-word (default ), cmd-lowercase-word (default ) / / . (SETTINGS) . : []int []string . anchorfind (bool) (default true) find . autoquit (bool) (default true) . borderfmt (string) (default \033[0m) . borderstyle (string) (default box) drawbox. : box roundbox box outline roundoutline outline separators cleaner (string) (default ``) (not called if empty) (cleaner). . previewer . : (1) (2) (3) (4) (5) (6) . . copyfmt (string) (default \033[7;33m) . cursoractivefmt (string) (default \033[7m), cursorparentfmt (string) (default \033[7m), cursorpreviewfmt (string) (default \033[4m) . cursoractivefmt cursorparentfmt cursorpreviewfmt . (inverted) . (underlined) . : \033[7;2m \033[7;90m . %s fmt.Sprintf . . \033[4m%s\033[0m \033[4m . cutfmt (string) (default \033[7;31m) (cut). dircounts (bool) (default false) ( calcdirsize ). . info size . 9999+ . dirfirst (bool) (default true) . dircounts size dirfirst . dironly (bool) (default false) . dirpreviews (bool) (default false) . drawbox (bool) (default false) . dupfilefmt (string) (default %f.~%n~) (duplicate). abc.txt abc.txt.~1~ . : %f %b ( ) %e ( ) %n . errorfmt (string) (default \033[7;31;47m) . %s fmt.Sprintf . \033[4m%s\033[0m \033[4m . filesep (string) (default \n) fs fv fx. filtermethod (string) (default text) . text ( ) glob ( ) regex ( ). SEARCHING FILES . findlen (int) (default 1) find. find . hidden (bool) (default false) . hiddenfiles . (hidden) . hiddenfiles ([]string) (default .* for Unix and `` for Windows) . . : * ? [...] [^...] . ! . : . : .*:lost+found:*.bak history (bool) (default true) . icons (bool) (default false) . ifs (string) (default ``) IFS . IFS=...; ... IFS . POSIX . . ignorecase (bool) (default true) . sortignorecase . ignoredia (bool) (default true) (diacritics) . sortignoredia . incfilter (bool) (default false) . incsearch (bool) (default false) . info ([]string) (default ``) . : perm user group size time atime btime ctime (inode) custom addcustominfo . infotimefmtnew (string) (default Jan _2 15:04) . infotimefmtold (string) (default Jan _2 2006) . menufmt (string) (default \033[0m) . menuheaderfmt (string) (default \033[1m) . menuselectfmt (string) (default \033[7m) . mergeindicators (bool) (default false) mergeindicators . tagfmt ( copyfmt) . mouse (bool) (default false) . number (bool) (default false) . relativenumber . numberfmt (string) (default \033[33m), numbercursorfmt (string) (default ``) . numberfmt . numbercursorfmt numberfmt . period (int) (default 0) . load . . lf . . preload (bool) (default false) previewer . preserve ([]string) (default mode) . mode ( ) timestamps ( ). Go . preview (bool) (default true) . . binary ( ) . previewer (string) (default ``) (not filtered if empty) (previewer) . . : (1) (2) (3) (4) (5) (6) ("preview" "preload"). SIGPIPE . . . preload preload . PREVIEWING FILES . promptfmt (string) (default \033[32;1m%u@%h\033[0m:\033[34;1m%d\033[0m\033[1m%f\033[0m) (prompt) . : %f %h (hostname) %u %w %d ( ) %F %S ( ) ~ . . ratios ([]int) (default 1:2:3) . . preview . relativenumber (bool) (default false) . number . reverse (bool) (default false) . rulerfile (string) (default ``) (ruler). . RULER . rulerfmt (string) (default ``) . statfmt rulerfile . rulerfile . : %a %p %m (cut) %c %s %v %t %h %f %i %P %d lf %{lf_} ( %{lf_selmode}) . %{lf_user_} ( %{lf_user_foo}) . | ( ) . scrolloff (int) (default 0) (offset) . . searchmethod (string) (default text) . text ( ) glob ( ) regex ( ). SEARCHING FILES . selectfmt (string) (default \033[7;35m) . selmode (string) (default all) . all . dir . shell (string) (default sh for Unix and cmd for Windows) . : shell shellopts shellflag command -- arguments. shellflag (string) (default -c for Unix and /c for Windows) . shellopts ([]string) (default ``) . showbinds (bool) (default true) . sizeunits (string) (default binary) (1K ) (1K ). smartcase (bool) (default true) ignorecase . ignorecase . smartdia (bool) (default false) ignoredia . ignoredia . sortby (string) (default natural) . : natural ( track_2 track_10 ) name (track_10 track_2 ) ext size time atime btime ctime (inode) custom addcustominfo sortignorecase (bool) (default true) . ignorecase . sortignoredia (bool) (default true) . ignoredia . statfmt (string) (default \033[36m%p\033[0m| %c| %u| %g| %S| %t| -> %l) . rulerfmt . rulerfile . : %p %c (link count) %u %g %s %S ( ) %t %l %m %M ( NORMAL ) | . tabstop (int) (default 8) (U+0009). tagfmt (string) (default \033[31m) . %s fmt.Sprintf . tempmarks (string) (default ``) ( abc a b c ). . ' . terminalcursor (string) (default default) . : default block underline bar blinkblock blinkunderline blinkbar. timefmt (string) (default Mon Jan _2 15:04:05 2006) . truncatechar (string) (default ~) . truncatepct (int) (default 100) . truncatepct ( ) . . (truncatechar) . . very_long_filename.txt: o set truncatepct 100 -> very_long_filena~.txt () o set truncatepct 50 -> very_lon~filename.txt o set truncatepct 0 -> ~ry_long_filename.txt visualfmt (string) (default \033[7;36m) . waitmsg (string) (default Press any key to continue) shell-wait . watch (bool) (default false) fsnotify . FUSE . wrapscan (bool) (default true) . wrapscroll (bool) (default false) (scroll) . user_{option} (string) (default none) user_ . lf_user_{option} . lf . (ENVIRONMENT VARIABLES) : POSIX $ ( $f) cmd % ( %f%) PowerShell $env: ( $env:f) . f . fs () filesep . fv () filesep . fx () (fs fv) (f). id . PWD . OLDPWD . LF_LEVEL lf lf . (prompt) lf . POSIX ( ~/.bashrc) : [ -n "$LF_LEVEL" ] && PS1="$PS1""(lf level: $LF_LEVEL) " OPENER . start open xdg-open . EDITOR VISUAL EDITOR . vi notepad . PAGER less more . SHELL sh cmd . lf lf lf. lf_{option} {option}. lf_user_{option} user_{option}. lf_flag_{flag} {flag}. lf_width, lf_height . lf_count . lf_mode lf . . : compmenu delete rename filter find mark search command shell pipe ( shell-pipe) normal visual unknown. (SPECIAL COMMANDS) . open open . paste paste . rename rename . delete delete . pre-cd . on-cd . on-load . . on-focus-gained . on-focus-lost . on-init . on-select . on-redraw . on-quit . (PREFIXES) lf : : read (default) $ shell % shell-pipe ! shell-wait & shell-async . . . . (SYNTAX) # : # # (set setlocal map nmap vmap cmap cmd) . set : set hidden # set hidden true # set nohidden # set hidden false # set hidden! # (toggle) set scrolloff 10 # set sortby time # set sortby 'time' # () set sortby "time" # ( ) setlocal . : dircounts dirfirst dironly hidden info reverse sortby sortignorecase sortignoredia. setlocal /foo/bar hidden # setlocal /foo/bar hidden true # setlocal /foo/bar nohidden # setlocal /foo/bar hidden false # setlocal /foo/bar hidden! # setlocal /foo/bar sortby time # setlocal /foo/bar sortby 'time' # setlocal /foo/bar sortby "time" # map : map gh cd ~ # map D trash # map i $less $f # map U !du -csh * # nmap (Normal mode). vmap (Visual mode). map : map (Normal, Visual) nmap (Normal) vmap (Visual) cmap (Command-line) cmap : cmap cmd-escape cmap set incsearch! : map gh # gh nmap v # v vmap o # o cmap # cmd : cmd usage $du -h -d1 | less : cmd trash # trash : : map zt set info time : map cmd : map st :set sortby time; set info time {{ }} : map st :{{ set sortby time set info time }} (KEY MAPPINGS) : map a down Shift : map A down < > : map down / : map down map down (Function keys) f : map down Ctrl c : map down Alt . ( xterm) Alt . : map a down ( gnome-terminal) Alt (escape) . lf Alt ( ). Alt a : map down : map down ( Ctrl+Shift+Space) . lf Vim . ( / ) : map down # map down # map down # (Meta) map down # map down # : . lf ( Ctrl+h backspace ). lf unknown mapping . m : map down # map down # map down # map down # map down # map down map down map down m : map down map down map down map down (PUSH MAPPINGS) . . push lf . . push map . : : map push 10j : map r push :rename push : map j push 2j (deadlock) . (SHELL COMMANDS) . () . : cmd trash ${{ mkdir -p ~/.trash if [ -z "$fs" ]; then mv "$f" ~/.trash else IFS="$(printf '\n\t')"; mv $fs ~/.trash fi }} $fs . $fx . : cmd trash ${{ mkdir -p ~/.trash IFS="$(printf '\n\t')"; mv $fx ~/.trash }} . : ${{ mkdir -p ~/.trash }} cmd trash ${{ IFS="$(printf '\n\t')"; mv $fx ~/.trash }} {{ }} : $mkdir -p ~/.trash cmd trash $IFS="$(printf '\n\t')"; mv $fx ~/.trash IFS . ifs ( set ifs "\n"). ( $rm $f $rm $fs ). . (PIPING SHELL COMMANDS) . . . . (stdin) (stdout) (stderr) . . : cmd rename %mv -i $f $1 . : cmd rename %[ -e $1 ] && printf "file exists" || mv $f $1 . (WAITING SHELL COMMANDS) . . . (ASYNCHRONOUS SHELL COMMANDS) . . (REMOTE COMMANDS) lf (remote commands) . . . . (Unix domain socket) . netcat (nc) OpenBSD . : echo 'send echo hello world' | nc -U ${XDG_RUNTIME_DIR:-/tmp/lf-$(id -u)}/lf.sock lf . lf . : lf -remote 'send echo hello world' send . (ID) : lf -remote 'send 1234 echo hello world' . $id . . . : lf -remote "send $id echo hello world" lf ( ) . : cmd recol %{{ if [ $lf_width -le 80 ]; then lf -remote "send $id set ratios 1:2" elif [ $lf_width -le 160 ]; then lf -remote "send $id set ratios 1:2:3" else lf -remote "send $id set ratios 1:2:3:5" fi }} query lf : lf -remote "query $id maps" : maps map nmap vmap nmaps nmap map vmaps vmap map cmaps cmap cmds cmd jumps history files lf : n (Normal) v (Visual) c (Command-line) lf . fzf : map ${{ clear cmd=$( lf -remote "query $id history" | awk -F'\t' 'NR > 1 { print $NF}' | sort -u | fzf --reverse --prompt='Execute command: ' ) lf -remote "send $id $cmd" }} list : lf -remote 'list' quit quit! : lf -remote 'quit' lf -remote 'quit!' conn drop : lf -remote 'conn $id' lf -remote 'drop $id' . (FILE OPERATIONS) lf . . --backup=numbered GNU cp . () ( preserve ) context . (pipes) . . lf . . ( ) . copy lf . paste . paste cut . paste . . : cmd paste %{{ load=$(cat ~/.local/share/lf/files) mode=$(echo "$load" | sed -n '1p') list=$(echo "$load" | sed '1d') if [ $mode = 'copy' ]; then cp -R $list . elif [ $mode = 'move' ]; then mv $list . rm ~/.local/share/lf/files lf -remote 'send clear' fi }} (--backup) (-a) cp mv rsync echo . lf delete . delete . . . (SEARCHING FILES) lf : (Searching) . (Finding) . search ( /) search-back ( ?) search-next ( n) search-prev ( N) . searchmethod glob . * ? [...] [^...] . searchmethod regex . RE2 Go : . incsearch . cmd-enter cmd-escape . cmap . : cmap :cmd-enter; open find ( f) find-back ( F) find-next ( ;) find-prev ( ,) . anchorfind ( ) . findlen . . : wrapscan . ignorecase ( smartcase ). ignoredia smartdia . (OPENING FILES) open ( l ) . . : cmd open $vi $fx : cmd open &xdg-open $f MIME file : cmd open ${{ case $(file --mime-type -Lb $f) in text/*) vi $fx;; *) for f in $fx; do xdg-open $f > /dev/null 2> /dev/null & done;; esac }} setsid lf . ($) ( xdg-open ) . (&) ( vi ) : cmd open &{{ case $(file --mime-type -Lb $f) in text/*) lf -remote "send $id \$vi \$fx";; *) for f in $fx; do xdg-open $f > /dev/null 2> /dev/null & done;; esac }} setsid . : cmd open &$OPENER $f . : libfile-mimeinfo-perl ( mimeopen) rifle ( ranger) mimeo. (PREVIEWING FILES) lf . . PDF . lf ANSI . previewer . : (1) (2) (3) (4) (5) (6) ("preview" "preload"). . ( MIME file) : #!/bin/sh case "$1" in *.tar*) tar tf "$1";; *.zip) unzip -l "$1";; *.rar) unrar l "$1";; *.7z) 7z l "$1";; *.pdf) pdftotext "$1" -;; *) highlight -O ansi "$1";; esac lf SIGPIPE . SIGPIPE . || true : highlight -O ansi "$1" || true (pager) : set previewer ~/.config/lf/pv.sh map i $~/.config/lf/pv.sh $f | less -R less LESSOPEN : set previewer ~/.config/lf/pv.sh map i $LESSOPEN='| ~/.config/lf/pv.sh %s' less -R $f . preload . lf ( sixel) ( ). (CHANGING DIRECTORY) lf . . lfcd : on-cd . : cmd on-cd &{{ bash -c ' # source /usr/share/git/completion/git-prompt.sh GIT_PS1_SHOWDIRTYSTATE=auto GIT_PS1_SHOWSTASHSTATE=auto GIT_PS1_SHOWUNTRACKEDFILES=auto GIT_PS1_SHOWUPSTREAM=auto git=$(__git_ps1 " (%s)") fmt="\033[32;1m%u@%h\033[0m:\033[34;1m%d\033[0m\033[1m%f$git\033[0m" lf -remote "send $id set promptfmt \"$fmt\"" ' }} (escape sequences) tty-write . xterm : cmd on-cd &{{ lf -remote "send $id tty-write \"\033]0;$PWD\007\"" }} . : cmd on-cd &{{ ... }} on-cd % & $ ! . pre-cd on-cd . on-load . (LOADING DIRECTORY) on-cd on-load . addcustominfo . (info) : cmd on-load &{{ cd "$(dirname "$1")" || exit 1 [ "$(git rev-parse --is-inside-git-dir 2>/dev/null)" = false ] || exit 0 cmds="" for file in "$@"; do case "$file" in */.git|*/.git/*) continue;; esac status=$(git status --porcelain --ignored -- "$file" | cut -c1-2 | head -n1) if [ -n "$status" ]; then cmds="${cmds}addcustominfo \"${file}\" \"$status\"; " else cmds="${cmds}addcustominfo \"${file}\" ''; " fi done if [ -n "$cmds" ]; then lf -remote "send $id :$cmds" fi }} : cmd on-load &{{ cmds="" for file in "$@"; do mime=$(file --mime-type -Lb -- "$file") case "$mime" in # image/svg+xml) ;; image/*|video/*) dimensions=$(exiftool -s3 -imagesize -- "$file") cmds="${cmds}addcustominfo \"${file}\" \"$dimensions\"; " ;; esac done if [ -n "$cmds" ]; then lf -remote "send $id :$cmds" fi }} (COLORS) lf . . : 1. (default) 2. LSCOLORS ( ls macOS/BSD) 3. LS_COLORS ( GNU ls) 4. LF_COLORS ( lf) 5. colors ( lf) LSCOLORS LS_COLORS . LF_COLORS LS_COLORS lf ls . colors ( CONFIGURATION ) . # . lf : lf . . . colors . LS_COLORS/LF_COLORS LSCOLORS . . . promptfmt ANSI . lf terminfo infocmp . $COLORTERM truecolor $TERM -truecolor . lf dircolors . (bold) . lf : ln 01;36 or 31;01 tw 01;34 ow 01;34 st 01;34 di 01;34 pi 33 so 01;35 bd 33;01 cd 33;01 su 01;32 sg 01;32 ex 01;32 fi 00 lf . : 1. ( ~/.config/lf/lfrc) 2. ( .git/) ( ) 3. ( ln) ( fi) 4. ( README*) 5. ( *README) 6. ( README.*) 7. ( *.txt) 8. ( fi) /path/to/README.txt : 1. /path/to/README.txt 2. ( ) 3. ( fi ) 4. README.txt* 5. *README.txt 6. README.* 7. *.txt 8. fi /path/to/example.d : 1. /path/to/example.d 2. example.d/ 3. di 4. example.d* 5. *example.d 6. example.* 7. *.d 8. fi . : export LF_COLORS="~/Documents=01;31:~/Downloads=01;31:~/.local/share=01;31:~/.config/lf/lfrc=31:.git/=01;32:.git*=32:*.gitignore=32:*Makefile=32:README.*=33:*.txt=34:*.md=34:ln=01;36:di=01;34:ex=01;32:" : export LF_COLORS="\ ~/Documents=01;31:\ ~/Downloads=01;31:\ ~/.local/share=01;31:\ ~/.config/lf/lfrc=31:\ .git/=01;32:\ .git*=32:\ *.gitignore=32:\ *Makefile=32:\ README.*=33:\ *.txt=34:\ *.md=34:\ ln=01;36:\ di=01;34:\ ex=01;32:\ " ln target . colors ( CONFIGURATION ) . colors : ANSI : (ICONS) LF_ICONS icons ( CONFIGURATION ) . LS_COLORS/LF_COLORS . ln target . icons # . : . . set icons true lfrc . lf : ln l or l tw t ow d st t di d pi p so s bd b cd c su u sg g ex x fi - icons : : (RULER) rulerfile ( CONFIGURATION ). Go (Go template) ( ). : .Message string echo/echomsg/echoerr .Keys string .Progress []string .Copy []string .Cut []string .Select []string .Visual []string .Index int () .Total int .Hidden int .All int .LinePercentage string ( %p statusline ) .ScrollPercentage string ( %P statusline ) .Filter []string .Mode string (NORMAL VISUAL ) .Options map[string]string ( {{.Options.hidden}}) .UserOptions map[string]string ( {{.UserOptions.foo}}) .Stat.Path string .Stat.Name string .Stat.Extension string .Stat.Size int64 .Stat.DirSize int64 calcdirsize .Stat.DirCount int dircounts .Stat.Permissions string .Stat.ModTime string ( timefmt) .Stat.AccessTime string ( timefmt) .Stat.BirthTime string ( timefmt) .Stat.ChangeTime string ( timefmt) .Stat.LinkCount string .Stat.User string .Stat.Group string .Stat.Target string .Stat.CustomInfo string addcustominfo : df func() string env func(string) string humanize func(int64) string join func([]string, string) string lower func(string) string substr func(string, int, int) string upper func(string) string {{.SPACER}} . : r42 2026-07-31 LF(1)