FM: a dired inspired TUI file manager

Written in rust.

fm-tui on crates.io fm-tui on docs.rs

``` FM : dired like file manager

Usage: fm [OPTIONS]

Options: -p, --path Starting path [default: .] -s, --server Nvim server [default: ] -h, --help Print help information -V, --version Print version information ```

Video

fm

Installation

sh cargo install fm-tui

Usage

Start it from command line with no parameters :

sh fm

or with a path :

sh fm -p ~/Downloads

If you added the recommanded function to your bashrc/zshrc, simply use f and you will cd to the last visited directory when exiting.

Features

Some features depends on external programs to keep fm from being really bloated.

Most of those features are inspired by ranger and alternatives (Midnight commander), the look and feel by dired.

Neovim filepicker

When you open a file with i, it will send an event to Neovim and open it in a new buffer. Recent versions of neovim export the RPC server address to an environement variable which is read if no argument is provided.

It should always work, even outside of neovim.

It's also possible to pass the RPC server address with fm -s address.

cd on quit

When leaving fm, it prints the last visited path. If you add this function to your zshrc / bashrc, it will listen to stdout and cd to the last dir.

bash function f() { # start the fm filemanager, enabling cd on quit. dest=$(fm $@) if [[ ! -z $dest ]] then cd $dest fi }

For fish users, this is the function to add to your config.fish

bash function f # start the fm filemanager, enabling cd on quit. set dest (fm $argv) if not test -z $dest cd $dest end end

Default keybindings

Press h by default to display the help. Your current keybindings are shown. Here are the default ones.

```

 Char('q'):      quit
 Char('h'):      help

 - Navigation -
 Left:           cd to parent directory
 Right:          cd to child directory
 Up:             one line up
 Down:           one line down
 Home:           go to first line
 End:            go to last line
 PageUp:         10 lines up
 PageDown:       10 lines down
 Tab:            cycle tab

 - Actions -
 Alt('f'):      toggle dual pane - if the width is sufficiant
 Alt('p'):       toggle a preview on the second pane
 Alt('e'):      toggle metadata on files
 Char('a'):      toggle hidden
 Char('s'):      shell in current directory
 Char('o'):      open the selected file
 Char('i'):      open in current nvim session
 Char('I'):      setup the nvim rpc address
 Char('P'):      preview this file
 Char('T'):       display infos about a media file
 Char('-'):      move back to previous dir
 Char('~'):      move to $HOME
 Char('M'):      mark current path
 Char('\''):     jump to a mark
 Char('f'):      search next matching element
 Ctrl('f'):      fuzzy finder
 Ctrl('s'):      fuzzy finder for line
 Ctrl('r'):      refresh view
 Ctrl('c'):      copy filename to clipboard
 Ctrl('p'):      copy filepath to clipboard
 Alt('d'):       dragon-drop selected file
 Alt('c'):       open the config file
 Char('W'):      set the selected file as wallpaper with nitrogen

 - Action on flagged files -
 Char(' '):      toggle flag on a file
 Char('*'):      flag all
 Char('u'):      clear flags
 Char('v'):      reverse flags
 Char('l'):      symlink to current dir
 Char('c'):      copy to current dir
 Char('p'):      move to current dir
 Char('x'):      delete files permanently
 Char('X'):      move to trash
 Char('C'):      compress into an archive
 Char('D'):      display the diff of the first 2 flagged files

 - Trash -
 Alt('o'):       Open the trash (enter to restore, del clear)
 Alt('x'):       Empty the trash

 - Tree -
 Navigate as usual. Most actions works as in 'normal' view.
 Char('t'):      Toggle tree mode
 Char('z'):      Fold a node
 Alt('z'):       Fold every node
 Char('Z'):      Unfold every node

 - MODES -
 Char('t'):      TREE
 Char('m'):      CHMOD
 Char('e'):      EXEC
 Char('d'):      NEWDIR
 Char('n'):      NEWFILE
 Char('r'):      RENAME
 Char('g'):      GOTO
 Char('w'):      REGEXMATCH
 Char('j'):      JUMP
 Char('O'):      SORT
 Char('H'):      HISTORY
 Char('G'):      SHORTCUT
 Char('E'):      ENCRYPTED DRIVE
     (m: open & mount,  u: unmount & close)
 Char('/'):      SEARCH
 Char(':'):      COMMAND
 Char('B'):      BULK
 Char('S'):      SHELL MENU
 Char('F'):      FILTER
     (by name "n name", by ext "e ext", only directories d or all for reset)
 Enter:  Execute mode then NORMAL
 Ctrl('q'):    NORMAL

 - MOC -
 Control MOC from your TUI
 CtrlUp:          Add a file or folder to the playlist
 CtrlLeft         Previous song
 CtrlDown:        Toggle play/pause. Start MOC if needed
 CtrlRight        Next song

```

Configuration

Every configuration file is saved in ~/.config/fm/

You can configure :

External dependencies

Most of the openers and tui applications are configurable from config files. Some are hardcode since their command is quite specific or if I couldn't find a workaround.

Contribution

Any help is appreciated.

I comment everything I do in dev.md.

It's my first "published" program, so don't get upset by the code quality.