wyne / fasder

Modern version of fasd file and directory access
MIT License
15 stars 1 forks source link
# Fasder - zoxide for files Fasder lets you access **files and directories lightning quick**. It remembers which files and directories you use most frequently, so you can access them in just a few keystrokes.
[Installation](#installation) • [Usage](#usage) • [Why Fasder?](#why-fasder) • [Features](#features) ![Demo](./demo.gif)

Fasder is a modern reimagining of clvv/fasd that offers zoxide-style “frecent” (frequent + recent) access to files and directories.

Fasder tracks your most-used files and directories and lets you access them with minimal keystrokes. Need to reopen your .zshrc? Just type v zsh from any directory.

Key Benefits

Examples

v def conf      # => vim /some/awkward/path/to/type/default.conf
j abc           # => cd /hell/of/a/awkward/path/to/get/to/abcdef
m movie         # => mplayer /path/to/awesome_movie.mp4
vim `f rc lo`   # => vim /etc/rc.local

Installation

Basic Install:

brew install wyne/tap/fasder
echo 'eval "$(fasder --init auto)"' >> ~/.zshrc

Full Install (with dependencies and default aliases):

brew install wyne/tap/fasder fzf
echo 'eval "$(fasder --init auto aliases)"' >> ~/.zshrc

Migrate from fasd:

cp ~/.fasd ~/.fasder

Usage

Pass aliases to init, example: --init auto aliases, to install these aliases:

a               # list files and directories
d               # directories only
f               # files only
v, vv           # open file in $EDITOR, vv for interactive
j, jj           # cd, jj for interactive

Example Commands

v def conf      # vim /awkward/path/default.conf
j abc           # cd /awkward/path/abcdef
vv foo          # Interactive file selection with fzf
jj foo          # Interactive directory navigation with fzf

The provided v and vv commands execute with program set in $EDITOR. Configure with: export EDITOR=nvim.

Base commands

fasder {query}        # files and directories
fasder -d {query}     # directories only
fasder -f {query}     # files only

{query} can be left empty to return all results

Example composition

alias a='fasder'        # both files and directories
alias d='fasder -d'     # directories only
alias f='fasder -f'     # files only
alias v='f -e $EDITOR'  # open file with $EDITOR
vim `f rc lo`           # on-the-fly command

See shell.go for provided aliases.

Options

fasder [options] [query ...]
  options:
        --init          Initialize fasder. Args: auto aliases
    -d, --directories   Dirs only
    -e, --exec {cmd}    Execute provided command against best match
    -f, --files         Files only
    -h, --help          Show this message
    -l, --list          List only. Omit rankings
    -R, --reverse       Reverse sort. Useful to pipe into fzf
    -s, --s             Show rank scores
    -v, --version       View version

Matching

Matching works similarly to zoxide and obeys the following rules:

Why fasder?

vs. zoxide

zoxide is great for directories. Fasder goes further—giving you quick access to both directories and files.

vs. fasd

fasd inspired fasder, but it’s now archived and written as a single, dense shell script. Fasder is built in a modern language, making it easier to read, maintain, and expand for more use cases.

Features