Skip to content


gokcehan edited this page Jul 15, 2019 · 8 revisions

Below are some shell tools that can be integrated into lf using regular or remote commands. Feel free to add more tools to this list as you like.


trash-cli can be used as command line interface for Trash specification. trash-cli already provides separate commands for trash operations (i.e. trash-put, trash-empty, trash-list, trash-restore, trash-rm) so you can simply map these commands to a key:

cmd trash %trash-put $fx

Note that trash-cli uses the same trashcan used by KDE, GNOME, and XFCE.


autojump can be used to jump to a directory in lf that contains a given string:

cmd aj %lf -remote "send $id cd '$(autojump $1)'"
map a push :aj<space>

Note that autojump relies on shell prompts to build and update its database, so it will only be updated when you run commands outside of lf or exit from lfcd function.


You can bind keys in lf to your usual fzf commands:

map f $vi $(fzf)

It is also possible to define commands with arguments to use with fzf:

cmd fzf $vi $(find . -name "$1" | fzf)
map f push :fzf<space>

If you want to jump to a file or directory in lf using fuzzy matching, you can utilize fzf for this purpose:

map f $lf -remote "send $id select '$(fzf)'"

vim / neovim

Vim script in etc/lf.vim only works in terminal vim and provides only a basic :LF command. There is a separate vim plugin Lf.vim that provides more features and can be used in gvim and neovim as well.


archivemount can be used to browse archives like directories. To integrate it with lf, the "open" command can be changed as follows:

cmd open ${{
    case "$f" in
            [ ! -d "$mntdir" ] && {
                mkdir "$mntdir"
                archivemount "$f" "$mntdir"
                echo "$mntdir" >> "/tmp/__lf_archivemount_$id"
            lf -remote "send $id cd \"$mntdir\""
            lf -remote "send $id reload"
            for f in $fx; do
                $OPENER $f > /dev/null 2> /dev/null &

To unmount archives after exiting, a wrapper over lf can be done like this (integrating with lfcd):

lfcd () {
    lf -command '$printf $id > '"$fid"'' -last-dir-path="$tmp" "$@"
    id="$(cat "$fid")"
    if [ -f "$archivemount_dir" ]; then
        cat "$archivemount_dir" | \
            while read -r line; do
                sudo umount "$line"
                rmdir "$line"
        rm -f "$archivemount_dir"
    if [ -f "$tmp" ]; then
        dir="$(cat "$tmp")"
        rm -f "$tmp"
        if [ -d "$dir" ]; then
            if [ "$dir" != "$(pwd)" ]; then
                cd "$dir"
Clone this wiki locally
You can’t perform that action at this time.