Skip to content

Naheel-Azawy/fmz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FMZ

File manager in a fuzzy finder.

./vid/2021-04-03-tiny.gif ./vid/fmz-2021-04-03_05.16.10.mp4

Dependencies

core utils and fzf.

Features

  • Pure POSIX
  • Does not re-implement what’s already in core utils
  • Easy configuration
  • Sane defaults
  • Fuzzy
  • Scriptable
  • Device management
  • Shell integration with cd on exit
  • Auto archive extraction
  • XDG trash
  • Check below for optional features

Optional dependencies/features

Having one of those is not a must, they only unlock new superpowers.

DependencySuperpower
stpvbetter previews with images
cp-pshow progress of cp and mv
archivemount (AUR)browse archives seamlessly
xclipcopy file names to X clipboard
dragondrag and drop
fdbetter find
perl-file-mimeinfoXDG open with
udisks2mount and unmount devices
simple-mtpfs (AUR)mount and unmount MTP devices
giomount and unmount gvfs devices
dunstactions with mount notifications
vidir (moreutils)bulk rename in a directory

Installation

make install

Shell integration

  • sh
    fmz() {
        tmp=$(mktemp)
        command fmz --cd "$tmp" "$@"
        res=$(tail -n 1 "$tmp")
        if [ -d "$res" ] && [ "$res" != "$PWD" ]; then
            echo cd "$res"
            cd "$res" || return 1
        fi
        rm "$tmp"
    }
        
  • fish
    function fmz
    set tmp (mktemp)
    command fmz --cd $tmp $argv
    set res (tail -n 1 $tmp)
    if test -d "$res" && test "$res" != "$PWD"
       echo cd $res
       cd $res || return 1
       end
       rm $tmp
       end
        

Default bindings

In general, CUA-like bindings where used, M-x for menu, and F1 to show all bindings.

Configuration

Config file is just a shell script that gets sourced in fmz. So be sure not to have the setuid bit set on fmz. Key symbols are as defined by fzf (check man fzf). You can bind fzf actions, functions (using fun), or quick functions that does not need f and fx (using funq). Example config file (~/.config/fmzrc.sh):

# basic bindings
bind alt-w  fun  copy
bind ctrl-w fun  move
bind ctrl-y funq paste
bind ctrl-c      abort

# add a function to menu and bind it
add_fun myless 'Less a file'
bind ctrl-p fun myless
myless() {
    tput rmcup
    less "$f"
}

# bookmarks
bookmark ~/Documents
bookmark ~/Pictures
bookmark ~/Videos

# other variables
OPENER=xdg-open
TERMINAL=st

Mount monitor

fmz --mount-monitor

If dunstify exists, the notification action will mount the drive and open fmz in a terminal window. notify-send can be used instead but clicking won’t do anything. The default bind for unmounting the current directory is ctrl-u.

Why?

I tried many other file managers like mc, ranger, lf, nnn, fff, and several others that I forgot. From the GUI world, it worth mentioning nautilus, nemo, thunar, and pantheon’s files. They all are cool in some way, but still not as good as I wanted. If you’re here, probably there’s no need to talk about GUI. Out of all the terminal file managers, lf has been my choice for a pretty long time and I do believe that it is the best out of the ones I just mentioned. However, with time, I started realizing lf problems. Here are some of what I recall:

  • A bit of unnecessary bloat. lf is relatively so minimal. But, in my opinion, there are some unnecessary parts like the builtin copy implementation and the config parser.
  • Too much configuration lf is almost unusable out of the box. Minimalism is good of course, but having some sane defaults can be done without being bloated too.
  • I use fzf anyway… Even inside lf, I used to have a key binding to fzf to find and jump to wherever I want. In practice, I found myself opening fzf almost every time I use lf. I’m not trying to say lf is bad. It is amazing. It just wasn’t enough for me.

License

GPL3

About

File manager in a fuzzy finder

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published