Home

Awesome

<div style="text-align:center"><img src="../assets/fastdiract_logo.png?raw=true" width="500"></div>

Overview

fastdiract (fastdir + fastaction) is a pair of shell tools based on key-value storage for quick shell navigation and command execution.

Each tool saves directories/commands to one of 10 "memory" slots in a file for quick retrieval via 2-character aliases (d0-d9 and f0-f9).

Fastdir

fastdir is a shell navigation tool to help you store and jump to your most frequently used directories (aka fastdirs), stored in slots d0-d9.

For example, you can cd to a /deep/very/deep/directory and run d2. to save that location to slot d2. In the future, whenever you run d2, you will jump to that saved directory.

Here's fastdir cycling through 7 directories in about 4 seconds:

<img src="../assets/fastdiract_fastdirs.gif?raw=true" width="500">

More commands:

Fastaction

fastaction is a tool to save frequently executed commands, stored in slots f0-f9. To save a command to slot f7, run something like f7. "echo hello there > myfile", making sure to wrap the command in double or single quotes. You can then execute the command easily by running f7.

<img src="../assets/fastdiract_fastactions.gif?raw=true" width="500">

More commands:

Fastdiract Contexts

For situations where there are more than 10 items to save and remember, fastdiract supports the creation and management of "contexts", which can be switched between easily.

The following gif shows how fastdir contexts are switched and used (the same can be done for fastaction contexts).

<img src="../assets/fastdiract_fastdir_ctx.gif?raw=true" width="500">

Installation

To install fastdiract, run install.sh.

fzf must be installed to support fastdir/fastaction context switching, and python is needed to support setting fastactions.

Customization

fastdiract starts with some sane defaults, but it can be configured by changing the following options in the definitions file:

Configuration VariableDescription
FASTDIR_POSTCMDCommand to execute after jumping to a fastdir, e.g. ls
FASTDIR_ECHOWhether to echo the fastdir command being executed, e.g. cd mydir
FASTACT_ECHOWhether to echo the fastaction command being executed, e.g. echo 'hello there'
FASTACT_CONFWhether to prompt for a y/n confirmation before executing a fastaction command
FASTACT_MENU_CONFWhether to prompt for a y/n confirmation before executing a fastaction from the menu (fm)
FASTACT_D_RUNS_MENUIf set to "on", running d will run the fastdir menu (dm). Otherwise, d will just display the current fastdirs.
FASTACT_F_RUNS_MENUIf set to "on", running f will run the fastaction menu (fm). Otherwise, f will just display the current fastactions.
CTX_COLORCan be set to an ANSI color code for highlighting the context in different fastdiract commands. The default is green (\033[1;32m).

Misc

You can use fastaction commands recursively and use fastdir commands in fastaction commands, e.g. f1. = "d1 && f2 && echo hello"

Why would you want something like this when there are so many other directory navigation tools?

If you don't have fzf or would like to use a more stripped down version of fastdiract without contexts, check out the minimal branch.

Acknowledgements

The hand icon in the logo was created by nightwolfdezines and comes from Vecteezy.