fzf file manager

interpretive language scripts


Moderator: Forum moderators

Post Reply
User avatar
sc0ttman
Posts: 93
Joined: Sat Aug 22, 2020 3:55 pm
Has thanked: 4 times
Been thanked: 33 times

fzf file manager

Post by sc0ttman »

fzf filemanager

A file manager for the terminal, using fzf.

Homepage: https://github.com/sc0ttj/fzf-filemanager

Screenshot

Image

Features

  • fast navigation
  • sensible key bindings
  • easy directory & file searching
  • file previews of various types
  • open selected file(s) in various programs, based on MIME type or extension
  • integrated command prompt

Has 2 modes:

  • filemanager: browse and select files and folders
  • shellprompt: run commands on the current selection

This is a hack, not than a proper thing, don't expect too much.

Requirements

  • fzf - used for filtering and choosing files & dirs

Optional:

  • exa - used for listing dirs (supports .gitignore, icons, ..)
  • bat - used for colourful file previews
  • fd - used for Alt-C (finding lots of dirs, many levels deep)

Usage

Code: Select all

filemanager [-fs] [path/to/dir]

You can load fzf filemanager fullscreen (-fs) and pass the directory to start in.

"file manager" mode

You can navigate around your files and folders, TAB to multi-select,
or ENTER to open current selection, ESC to clear your selection.

If you open one file, it's mime-type will be used to decide what to do.

If you open many files, and they're of the same type, they will all be
opened together in the same program (your preferred, editor, player, etc).

If you chose files of different types, they'll be opened one after the other.

Alternatively, you can TAB select multiple files and press ! to open the
"shellprompt" mode, where you can run any commands you like against the selection.

"shell prompt" mode

Here you can run commands on the "current selection" (the files/dirs you
chose using enter or tab, in the file manager).

You will see a long list of commands, type to filter them and choose the
command you want to run.

Hit enter to run the chosen command on each item in the "current selection".

Key bindings

Key bindings: all modes

  • ! - enter/exit shell prompt mode
  • ctrl-q - quit

Key Bindings: "filemanager" mode

Navigation:

  • up/down - move up and down the file/dir list
  • left - cd to ..
  • right - cd into the current dir, or open the currently selected file(s)
  • shift+up/down or page-up/page-down - move up and down, half a page at a time
  • shift+left/right or ] and [ - scroll the preview panel up and down

Choosing items:

  • enter or / - choose item
  • tab - toggle item (multi select) and move down
  • shift-tab - toggle item (multi-select) and move up
  • escape - clear selection

File manager controls:

  • shift+/ - (the ? key) a help menu showing the controls
  • ctrl-l - toggle "long" (detailed) list view
  • ctrl-h - toggle show/hide hidden files
  • ctrl-p - toggle show/hide the preview panel
  • alt-c - list & filter all dirs from ., hit enter to cd into one

Searching

Just type stuff while in any dir to start filtering the list.

Key Bindings: "shell prompt" mode

  • up/down - move up and down the command list
  • shift+up/down - move up and down your command history
  • tab - complete the selected command, in one go
  • enter - choose and run the chosen command on the selected files/dirs
  • ctrl-q - exit back to main prompt menu, or exit program

Contributing

Pull Requests welcome.

Just read the Issues page, pick one, fix it, issue a PR.

Also see the lines marked @TODO, at the top of the script itself.

User avatar
Grey
Posts: 2024
Joined: Wed Jul 22, 2020 12:33 am
Location: Russia
Has thanked: 76 times
Been thanked: 376 times

Re: fzf file manager

Post by Grey »

sc0ttman wrote: Thu Sep 01, 2022 3:52 pm

A file manager for the terminal, using `fzf`.

I liked the presence of cave_story on the screenshot the most. And again cheat :) What is happening on the forum. One is cheating in Dune 2, the other seems to be in Cave Story :)

Fossapup OS, Ryzen 5 3600 CPU, 64 GB RAM, GeForce GTX 1050 Ti 4 GB, Sound Blaster Audigy Rx with amplifier + Yamaha speakers for loud sound, USB Sound Blaster X-Fi Surround 5.1 Pro V3 + headphones for quiet sound.

Burunduk
Posts: 255
Joined: Thu Jun 16, 2022 6:16 pm
Has thanked: 7 times
Been thanked: 127 times

Re: fzf file manager

Post by Burunduk »

What font is on the screenshot? I only can get something similar by installing the awesome font. It lacks some glyphs and appears in the geany terminal but not in the urxvt.

The DejaVu Nerd Font gives small narrow icons, especially for directories.

Edit: OK, never mind. I've found the reason. Even two of them: the wrong font and the wrong terminal emulator.
The DejaVu Sans Mono Nerd Font Complete.ttf (only one mono in the name) should be used instead of the DejaVu Sans Mono Nerd Font Complete Mono.ttf (two mono). And urxvt doesn't like it showing most of the special characters as squares. In the geany terminal, the font looks exactly as on the screenshot.

Post Reply

Return to “Scripts”