fzftools is an organized collection of FZF scripts with a consistent interface.
If you use bash:
$ git clone https://github.com/midchildan/fzftools.git
$ echo source "$(pwd)/fzftools.bash" >> ~/.bashrc
Or, if you use zsh:
$ git clone https://github.com/midchildan/fzftools.git
$ echo source "$(pwd)/fzftools.zsh" >> ~/.zshrc
$ fzf-sel dir
$ fzf-sel git commit
$ fzf-run cd dir
$ fzf-run brew install formula
$ fzf-run vim "git file"
You can also pass additional arguments:
$ fzf-run vim "git file" --remote-tab-silent
$ fzf-run git rebase commit -i
$ fzf-loop git show commit
fzftools provides two commands: fzf-sel and fzf-run.
Usage: fzf-sel selector
Filters list of items associated with selector
using FZF. Examples of
available selectors are:
- dir
- dirstack
- file
- fc
- process
- brew formula
- brew installed
- brew leaves
- brew cask cask
- brew cask installed
- git branch
- git commit
- git file
- git remote
- git stash
- git status
- git tag
Usage: fzf-run command [subcommands...] selector [flags...]
Runs command
with the output of fzf-sel selector
as its arguments.
Usage: fzf-loop command [subcommands...] selector [flags...]
Reapetedly run fzf-run
until selection is canceled.
You can add a custom selector
by defining fzf::sel::$(selector)
as a
function. You can also customize the behavior of fzf-run command
by defining
fzf::run::$(command)
as a function.
See LICENSE.