| Crates.io | fm-tui |
| lib.rs | fm-tui |
| version | 0.2.2 |
| created_at | 2022-12-17 13:16:20.879451+00 |
| updated_at | 2026-01-19 19:14:06.391382+00 |
| description | FM : a file manager inspired by ranger and dired{n}{n}Config files ~/.config/fm/{n}Documentation https://github.com/qkzk/fm{n} |
| homepage | |
| repository | https://github.com/qkzk/fm |
| max_upload_size | |
| id | 739882 |
| size | 1,297,510 |
$ fm --help
FM : a file manager inspired by ranger and dired
Config files ~/.config/fm/
Documentation https://github.com/qkzk/fm
Usage: fm [OPTIONS]
Options:
-p, --path <PATH> Starting path. directory or file [default: .]
-s, --server <SERVER> Nvim server [default: ]
-A, --all Display all files (hidden)
-l, --log Enable logging
--neovim Started inside neovim terminal emulator
--input-socket <INPUT_SOCKET> UNIX Socket file used to send messages to FM
--output-socket <OUTPUT_SOCKET> UNIX Socket file used by fm to send messages
-h, --help Print help
-V, --version Print version
$ fmconfig --help
Welcome to Fm configuration application.
FM : a file manager inspired by ranger and dired
Config files ~/.config/fm/
Documentation https://github.com/qkzk/fm
Usage: fmconfig [OPTIONS] [COMMAND]
Commands:
plugin Plugin management. fm plugin -h for more details
help Print this message or the help of the given subcommand(s)
Options:
--keybinds Print keybinds
--cloudconfig Configure a google drive client
--clear-cache Clear the video thumbnail cache
--reset-config Reset the config file
-h, --help Print help
-V, --version Print version
fmconfig plugin --help :
$ fmconfig plugin -h`
Welcome to Fm configuration application.
Plugin management. fm plugin -h for more details
Usage: fmconfig plugin <COMMAND>
Commands:
add fmconfig plugin add <path_to_plugin.so>. Add a compiled plugin from its .so file
install fmconfig plugin install <author/repo>. Install a plugin from github fmconfig plugin install <https://hostname/author/repo>. Install a plugin from `hostname` (gitlab, codeberg etc.)
remove fmconfig plugin remove <name>. Remove a plugin by its name
list fmconfig plugin list. List all installed plugins
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print help
fmconfig is still in early stages and may change a lot.
X11-Linux is the only supported platform. It may be usable on MacOS or Wayland but I can't be sure since I can't test them. It should work over ssh or without a GUI on any linux platform.

cargo install fm-tui --locked
Start it from command line with no parameters :
fm
or with a path :
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.
Some features depends on external programs to keep fm from being really bloated. I try to implement every feature I can think of.
Display settings (use two panes, display metadata, use second pane as preview) are saved and restored when restarting the application.
Many ways to jump somewhere:
space (*: flag all, v: reverse, u: unflag)a/b/c which will create every intermediate folder if needed.You can preview a file directly (Shift-p) or by toggling preview mode in the right tab (Alt-p). While in this mode, navigating will update the display.
A lot of different file kinds can be previewed directly withing fm:
Most of this previewing is done externaly through shell commands. They require the appropriate software to be installed.
Note: previewing a LARGE directory of videos may be really slow.
You can install (with some help from fmconfig) previewer plugins. They should specify their extensions and return a Preview. The plugin itself is a .so file.
fm ships with "bat_previewer" which relies on bat to generate highlighted previews. It must be installed by the user otherwise we use the default highlighted text previewer which is fine too. It's just a demo.
3 ways.
# Plugins
# Plugins are external libs, written in rust.
# ATM only previewers plugins are supported.
plugins:
# previewer plugins able the preview some extensions.
# give them a name (what ever you want) and the path to "libplugin_something.so".
# Under normal circonstances, the file should be in `crate_your_plugin/target/release/libcrate_your_plugin.so`
# If you only avec sources and nothing in target, try `cargo build --release` from the crate directory.
previewer:
'bat previewer': "/path/to/some/previewer/libbat_previewer.so"
fmconfig plugin add <PATH> where path leads to your libsomething.so file.Your plugin must provide 3 functions descibed below:
name which returns its name,is_match which takes a path and returns a boolean, set to true if your plugin can preview this file,preview which takes a path and returns a Preview.See bat_previewer for more an example of a "simple" plugin.
fmconfig plugin install qkzk/bat_previewerfmconfig plugin install https://github.com/qkzk/bat_previewerReplace the hostname, author and plugin name.
We use Nucleo, a fuzzy matcher made for Helix by the same author.
i and it will open it in Neovim using its exposed RPC server.It's also possible to pass the RPC server address with fm -s address.
You can specify an incoming socket to take control of fm and send it GO <path>, KEY <key> or ACTION <action> commands.
You can specify an outgoing socket to implement a file picker yourself. Opening a file with OPEN <path> or DELETE <path>.
It's what is done in the fm-picker plugin.
This API isn't stable yet and may change in a near future.
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.
function f() {
fm $@
dest=$(cat /tmp/fm_output.txt)
if [[ -n $dest ]]; then
cd "$dest"
fi
}
For fish users, this is the function to add to your config.fish
function f
# start the fm filemanager, enabling cd on quit.
fm $argv
set dest (cat /tmp/fm_output.txt)
if not test -z $dest
cd $dest
end
end
You can bind any unbound key to a shell command.
The command is executed in a new shell : sh -c "<YOUR COMMAND>".
Expansions :
With -l or --log, logs are enabled. They are disabled by default.
Critical actions will be logged to ~/.config/fm/log/fm.log and actions affecting the file tree will be logged to ~/.config/fm/log/action_logger.log.
The last action is displayed at the bottom of the screen and can be read with Alt+l like a preview.
Those logs can be seen even if logging is disabled, it just won't be up to date.
With the help of the amazing OpenDal library from Apache, you can access your remote GoogleDrive files within fm.
You must setup a client id and a client secret first. Once it's done, the helper fm --cloudconfig will create the configuration file for you.
It uses a refresh token which will automatically be refreshed for you by OpenDal.
Open the Cloud menu with Shift-Alt-C and pick a valid config file. Once done, you can navigate your files with the arrow keys, download them with Return, upload the selected file with u, Delete a remote file with X (no confirmation !) and create a new directory with d.
You can setup many google drive accounts but only one can be opened at once. Use l to leave the current one and select another one.
This is an advanced user feature with rough edges.
You need to provide credentials to access a google drive account. The only way to get them is to create a project in Google Cloud and share the credentials.
https://www.googleapis.com/auth/drive and create credentialsfm --cloudconfig and provide the requested informations.More infos about credentials can be found in the rclone documentation.
For some reason, GoogleDrive allows multiple files to have exactly the same name. ATM it crashes OpenDal in testing mode and those files are ignored in release mode. Only developpers of fm should be concerned.
Alt-" (to save) and " to jump.Most of those features are inspired by ranger, dired and alternatives (Midnight commander, nnn, lf etc.).
Press ctrl-h to display the help. Your current keybindings are shown. Here are the default ones.
Char('q') : quit
Ctrl('h') : help
- Navigation -
Left : cd to parent directory
Char('l') : cd to child directory
Up : one line up
Char('j') : one line down
Home : go to first line
Char('G') : go to last line
PageUp : 10 lines up
Char('J') : 10 lines down
Tab : cycle tab
- Actions -
Alt('d') : toggle dual pane - if the width is sufficiant
Alt('p') : toggle a preview on the second pane
Char('E') : toggle metadata on files
Char('a') : toggle hidden
Char('s') : shell in current directory
Char('o') : open the selected file with :
- default xdg-open
- audio mocp
- images viewnior
- office libreoffice
- pdf, ebooks zathura
- text nvim
- video mpv
- vectorials
- compressed files are decompressed
- iso images are mounted
Char('i') : open in current nvim session
Char('I') : setup the nvim rpc address
Char('P') : preview this file
Char('-') : move back to previous dir
Char('~') : move to $HOME
Char('`') : move to root (/)
Char('@') : move to starting point
Char('M') : mark current path
Char('\''): jump to a mark
Char('f') : search next matching element
Ctrl('f') : fuzzy finder for file
Ctrl('s') : fuzzy finder for line
Char('H') : fuzzy finder from help
Ctrl('r') : refresh view
Ctrl('c') : copy filename to clipboard
Ctrl('p') : copy filepath to clipboard
Alt('c') : open the config file
- 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('m') : move to current dir
Char('x') : delete files permanently
Char('X') : move to trash
Char('C') : compress into an archive
- 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
Ctrl('z') : Fold every node
Char('Z') : Unfold every node
- DISPLAY MODES -
Different modes for the main window
Ctrl('q') : NORMAL
Char('t') : TREE
Char('F') : FLAGGED
Char('P') : PREVIEW
- EDIT MODES -
Different modes for the bottom window
Alt('m') : CHMOD
Char('e') : OPEN WITH
Char('d') : NEWDIR
Char('n') : NEWFILE
Char('r') : RENAME
Alt('g') : CD
Char('w') : REGEXMATCH
Alt('j') : JUMP
Char('O') : SORT
Alt('h') : HISTORY
Ctrl('g') : SHORTCUT
Alt('e') : ENCRYPTED DRIVE
(m: open & mount, u: unmount & close, g: go there)
Alt('R') : REMOVABLE MTP DEVICES
(m: mount, u: unmount, g: go there)
Char('/') : SEARCH
Char(':') : ACTION
Alt('b') : BULK
Alt('s') : TUI APPS
Alt('i') : CLI APPS
Alt('r') : MOUNT REMOTE PATH
Alt('f') : FILTER
(by name "n name", by ext "e ext", "d only directories" or "a all" for reset)
Enter : Execute mode then NORMAL
- CUSTOM ACTIONS -
%s: the selected file,
%f: the flagged files,
%e: the extension of the file,
%n: the filename only,
%d: the full path of the current directory,
%t: execute the command in the same window,
%c: the current clipboard as a string.
Alt('u'): /usr/bin/google-chrome-stable %s
Char('D'): /usr/bin/dragon-drop %s
Every configuration file is saved in ~/.config/fm/
You can configure :
S and pick the desired one. It will only work with a TUI application like HTOP,
not a CLI application like bat.Most of the openers and tui applications are configurable from config files. Some are hardcoded if their command is quite specific or if I couldn't find a workaround.
lsblk: list encrytped devices
faillock: reset failed sudo attempts
Cryptsetup: decrypt & mount encrypted devices
Nitrogen: set up a wallpaper
Dragon-Drop drag-and-drop a file from a terminal to a GUI application.
Ueberzug display images in your terminal. Used to preview images. You can display images within WezTerm directly with the help of iterm2's Inline Image Protocol
isoinfo allow the content preview of an iso file
jupyter preview jupyter notebooks by converting them to markdown
pandoc preview epub by converting them to markdown with pandoc
fontimage preview fonts by creating a thumbnail
rsvg-convert preview svg by creating a thumbnail
libreoffice preview OpenOffice & MS-office documents
pdftoppm to convert a .pdf into a displayable .jpg
pdfinfo to get the number of pages of a pdf file
sshfs to mount remote filesystem over SFTP.
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.