• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

.travis.ymlH A D17-Sep-2020215 118

LICENSE.mdH A D17-Sep-20201.1 KiB2217

MakefileH A D17-Sep-2020516 2117

README.mdH A D17-Sep-20209.9 KiB405305

fffH A D03-May-202232.3 KiB1,142675

fff.1H A D17-Sep-20205.2 KiB266205

README.md

1# fff (*Fucking Fast File-Manager*)
2
3<a href="https://asciinema.org/a/qvNlrFrGB3xKZXb6GkremjZNp" target="_blank"><img src="https://asciinema.org/a/qvNlrFrGB3xKZXb6GkremjZNp.svg" alt="img" height="210px" align="right"/></a>
4
5A simple file manager written in `bash`.
6
7<a href="https://travis-ci.org/dylanaraps/fff"><img src="https://travis-ci.org/dylanaraps/fff.svg?branch=master"></a>
8<a href="https://github.com/dylanaraps/fff/releases"><img src="https://img.shields.io/github/release/dylanaraps/fff.svg"></a>
9<a href="https://repology.org/metapackage/fff"><img src="https://repology.org/badge/tiny-repos/fff.svg" alt="Packaging status"></a>
10
11- It's Fucking Fast ��
12- Minimal (*only requires **bash** and coreutils*)
13- Smooth Scrolling (*using **vim** keybindings*)
14- Works on **Linux**, **BSD**, **macOS**, **Haiku** etc.
15- Supports `LS_COLORS`!
16- File Operations (*copy, paste, cut, **ranger style bulk rename**, etc*) <img src="https://i.imgur.com/tjIWUjf.jpg" alt="img" height="213px" align="right"/>
17- Instant as you type search
18- Tab completion for all commands!
19- Automatic CD on exit (*see [setup](#cd-on-exit)*)
20- Works as a **file picker** in `vim`/`neovim` ([**link**](https://github.com/dylanaraps/fff.vim))!
21- **Display images with w3m-img!**
22- Supports `$CDPATH`.
23
24
25## Table of Contents
26
27<!-- vim-markdown-toc GFM -->
28
29* [Dependencies](#dependencies)
30* [Installation](#installation)
31    * [Distros](#distros)
32    * [Manual](#manual)
33    * [CD on Exit](#cd-on-exit)
34        * [Bash and Zsh](#bash-and-zsh)
35        * [Fish](#fish)
36* [Usage](#usage)
37* [Customization](#customization)
38* [Customizing the keybindings.](#customizing-the-keybindings)
39    * [Keybindings](#keybindings)
40    * [Disabling keybindings.](#disabling-keybindings)
41    * [Dealing with conflicting keybindings.](#dealing-with-conflicting-keybindings)
42    * [How to figure out special keys.](#how-to-figure-out-special-keys)
43* [Using `fff` in vim/neovim as a file picker](#using-fff-in-vimneovim-as-a-file-picker)
44* [Why?](#why)
45
46<!-- vim-markdown-toc -->
47
48
49## Dependencies
50
51- `bash 3.2+`
52- `coreutils`
53    - File operations.
54- `xdg-utils` (*optional*)
55    - Program handling (*non-text*).
56    - *Not needed on macos and Haiku.*
57    - *Customizable (if not using `xdg-open`): `$FFF_OPENER`.*
58
59**Dependencies for image display**
60
61- `w3m-img`
62- `xdotool` for X.
63- `fbset` for the framebuffer.
64
65
66## Installation
67
68### Distros
69
70- KISS Linux (based): `kiss b fff`
71- FreeBSD: `pkg install fff`
72- Haiku: `pkgman install fff`
73- macOS: `brew install fff`
74- Nix: `nix-env -iA fff`
75- Void Linux: `xbps-install -S fff`
76- Arch Linux: `pacman -S fff`
77
78### Manual
79
801. Download `fff`.
81    - Release: https://github.com/dylanaraps/fff/releases/latest
82    - Git: `git clone https://github.com/dylanaraps/fff`
832. Change working directory to `fff`.
84    - `cd fff`
853. Run `make install` inside the script directory to install the script.
86    - **El Capitan**: `make PREFIX=/usr/local install`
87    - **Haiku**: `make PREFIX="$(finddir B_USER_NONPACKAGED_DIRECTORY)" MANDIR='$(PREFIX)/documentation/man' DOCDIR='$(PREFIX)/documentation/fff' install`
88    - **OpenIndiana**: `gmake install`
89    - **MinGW/MSys**: `make -i install`
90    - **NOTE**: You may have to run this as root.
91
92**NOTE:** `fff` can be uninstalled easily using `make uninstall`. This removes all of files from your system.
93
94### CD on Exit
95#### Bash and Zsh
96```sh
97# Add this to your .bashrc, .zshrc or equivalent.
98# Run 'fff' with 'f' or whatever you decide to name the function.
99f() {
100    fff "$@"
101    cd "$(cat "${XDG_CACHE_HOME:=${HOME}/.cache}/fff/.fff_d")"
102}
103```
104#### Fish
105```sh
106# Add this to you config.fish or equivalent.
107# Fish don't support recursive calls so use f function
108function f
109    fff $argv
110    set -q XDG_CACHE_HOME; or set XDG_CACHE_HOME $HOME/.cache
111    cd (cat $XDG_CACHE_HOME/fff/.fff_d)
112end
113```
114
115## Usage
116
117```sh
118j: scroll down
119k: scroll up
120h: go to parent dir
121l: go to child dir
122
123enter: go to child dir
124backspace: go to parent dir
125
126-: Go to previous dir.
127
128g: go to top
129G: go to bottom
130
131:: go to a directory by typing.
132
133.: toggle hidden files
134/: search
135t: go to trash
136~: go to home
137e: refresh current dir
138!: open shell in current dir
139
140x: view file/dir attributes
141i: display image with w3m-img
142
143down:  scroll down
144up:    scroll up
145left:  go to parent dir
146right: go to child dir
147
148f: new file
149n: new dir
150r: rename
151X: toggle executable
152
153y: mark copy
154m: mark move
155d: mark trash (~/.local/share/fff/trash/)
156s: mark symbolic link
157b: mark bulk rename
158
159Y: mark all for copy
160M: mark all for move
161D: mark all for trash (~/.local/share/fff/trash/)
162S: mark all for symbolic link
163B: mark all for bulk rename
164
165p: paste/move/delete/bulk_rename
166c: clear file selections
167
168[1-9]: favourites/bookmarks (see customization)
169
170q: exit with 'cd' (if enabled).
171Ctrl+C: exit without 'cd'.
172```
173
174## Customization
175
176```sh
177# Show/Hide hidden files on open.
178# (Off by default)
179export FFF_HIDDEN=1
180
181# Use LS_COLORS to color fff.
182# (On by default if available)
183# (Ignores FFF_COL1)
184export FFF_LS_COLORS=1
185
186# Directory color [0-9]
187export FFF_COL1=2
188
189# Status background color [0-9]
190export FFF_COL2=7
191
192# Selection color [0-9] (copied/moved files)
193export FFF_COL3=6
194
195# Cursor color [0-9]
196export FFF_COL4=1
197
198# Status foreground color [0-9]
199export FFF_COL5=0
200
201# Text Editor
202export EDITOR="vim"
203
204# File Opener
205export FFF_OPENER="xdg-open"
206
207# File Attributes Command
208export FFF_STAT_CMD="stat"
209
210# Enable or disable CD on exit.
211# (On by default)
212export FFF_CD_ON_EXIT=0
213
214# CD on exit helper file
215# Default: '${XDG_CACHE_HOME}/fff/fff.d'
216#          If not using XDG, '${HOME}/.cache/fff/fff.d' is used.
217export FFF_CD_FILE=~/.fff_d
218
219# Trash Directory
220# Default: '${XDG_DATA_HOME}/fff/trash'
221#          If not using XDG, '${HOME}/.local/share/fff/trash' is used.
222export FFF_TRASH=~/.local/share/fff/trash
223
224# Trash Command
225# Default: 'mv'
226#          Define a custom program to use to trash files.
227#          The program will be passed the list of selected files
228#          and directories.
229export FFF_TRASH_CMD="mv"
230
231# Favourites (Bookmarks) (keys 1-9) (dir or file)
232export FFF_FAV1=~/projects
233export FFF_FAV2=~/.bashrc
234export FFF_FAV3=~/Pictures/Wallpapers/
235export FFF_FAV4=/usr/share
236export FFF_FAV5=/
237export FFF_FAV6=
238export FFF_FAV7=
239export FFF_FAV8=
240export FFF_FAV9=
241
242# w3m-img offsets.
243export FFF_W3M_XOFFSET=0
244export FFF_W3M_YOFFSET=0
245
246# File format.
247# Customize the item string.
248# Format ('%f' is the current file): "str%fstr"
249# Example (Add a tab before files): FFF_FILE_FORMAT="\t%f"
250export FFF_FILE_FORMAT="%f"
251
252# Mark format.
253# Customize the marked item string.
254# Format ('%f' is the current file): "str%fstr"
255# Example (Add a ' >' before files): FFF_MARK_FORMAT="> %f"
256export FFF_MARK_FORMAT=" %f*"
257```
258
259## Customizing the keybindings.
260
261### Keybindings
262
263This is the list of full keybindings along with their default values. You only need to modify the keybindings that you'd like to change from the default. `fff` will run perfectly fine without any of these defined.
264
265```sh
266### Moving around.
267
268# Go to child directory.
269export FFF_KEY_CHILD1="l"
270export FFF_KEY_CHILD2=$'\e[C' # Right Arrow
271export FFF_KEY_CHILD3=""      # Enter / Return
272
273# Go to parent directory.
274export FFF_KEY_PARENT1="h"
275export FFF_KEY_PARENT2=$'\e[D' # Left Arrow
276export FFF_KEY_PARENT3=$'\177' # Backspace
277export FFF_KEY_PARENT4=$'\b'   # Backspace (Older terminals)
278
279# Go to previous directory.
280export FFF_KEY_PREVIOUS="-"
281
282# Search.
283export FFF_KEY_SEARCH="/"
284
285# Spawn a shell.
286export FFF_KEY_SHELL="!"
287
288# Scroll down.
289export FFF_KEY_SCROLL_DOWN1="j"
290export FFF_KEY_SCROLL_DOWN2=$'\e[B' # Down Arrow
291
292# Scroll up.
293export FFF_KEY_SCROLL_UP1="k"
294export FFF_KEY_SCROLL_UP2=$'\e[A'   # Up Arrow
295
296# Go to top and bottom.
297export FFF_KEY_TO_TOP="g"
298export FFF_KEY_TO_BOTTOM="G"
299
300# Go to dirs.
301export FFF_KEY_GO_DIR=":"
302export FFF_KEY_GO_HOME="~"
303export FFF_KEY_GO_TRASH="t"
304export FFF_KEY_REFRESH="e"
305
306### File operations.
307
308export FFF_KEY_YANK="y"
309export FFF_KEY_MOVE="m"
310export FFF_KEY_TRASH="d"
311export FFF_KEY_LINK="s"
312export FFF_KEY_BULK_RENAME="b"
313
314export FFF_KEY_YANK_ALL="Y"
315export FFF_KEY_MOVE_ALL="M"
316export FFF_KEY_TRASH_ALL="D"
317export FFF_KEY_LINK_ALL="S"
318export FFF_KEY_BULK_RENAME_ALL="B"
319
320export FFF_KEY_PASTE="p"
321export FFF_KEY_CLEAR="c"
322
323export FFF_KEY_RENAME="r"
324export FFF_KEY_MKDIR="n"
325export FFF_KEY_MKFILE="f"
326export FFF_KEY_IMAGE="i" # display image with w3m-img
327
328### Miscellaneous
329
330# Show file attributes.
331export FFF_KEY_ATTRIBUTES="x"
332
333# Toggle executable flag.
334export FFF_KEY_EXECUTABLE="X"
335
336# Toggle hidden files.
337export FFF_KEY_HIDDEN="."
338```
339
340### Disabling keybindings.
341
342You can't unset keybindings by making their value `''`. What you need to do is change their value to `off`.
343
344Example:
345
346```sh
347# KEY_GO_TRASH was bound to 't', now its unset.
348export FFF_KEY_GO_TRASH="off"
349
350# KEY_MKFILE is now set to 't' and its original
351# keybinding is also unset 'f'.
352export FFF_KEY_MKFILE="t"
353```
354
355### Dealing with conflicting keybindings.
356
357When rebinding a key in `fff` make sure you don't have two bindings with the same value. You can avoid this by setting the other conflicting key-binding to something else or by changing its value to `off`.
358
359
360### How to figure out special keys.
361
362Below is a tiny script I've written which will tell you the exact value to use. It automates the deciphering of special key escape sequences to the exact value `fff` needs. Save this to a file and run it. Give it a key-press and it'll spit out the exact value needed.
363
364```sh
365#!/usr/bin/env bash
366# Output the key-binding values for 'fff'.
367key() {
368    case "$1" in
369        # Backspace.
370        $'\b'|$'\177')
371            printf '%s\n' "key: \$'\\b' or \$'\\177'"
372        ;;
373
374        # Escape Sequences.
375        $'\e')
376            read -rsn 2
377            printf '%s %q\n' "key:" "${1}${REPLY}"
378        ;;
379
380        # Return / Enter.
381        "")
382            printf '%s\n' "key: \" \""
383        ;;
384
385        # Everything else.
386        *)
387            printf '%s %q\n' "key:" "$1"
388        ;;
389    esac
390}
391
392read -srn 1 && key "$REPLY"
393```
394
395## Using `fff` in vim/neovim as a file picker
396
397See: [**`fff.vim`**](https://github.com/dylanaraps/fff.vim)
398
399
400## Why?
401
402¯\\_(ツ)_/¯
403
404<sup><sub>dont touch my shrug</sub></sup>
405