• Stars
    star
    154
  • Rank 242,095 (Top 5 %)
  • Language
    Shell
  • License
    Apache License 2.0
  • Created about 4 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

ZSH plugin to enable fzf searches of a lot more stuff - docker, tmux, homebrew and more.

fzf-zsh-plugin

License Awesomebot Superlinter Code Climate

Table of Contents

This ZSH plugin enables using fzf to search your command history and do file searches.

It will automagically install fzf into your home directory if it isn't already there, and bind ^R to an fzf-powered search of your command history.

Created for the zsh-quickstart-kit to make the default setup have a more 'batteries included' feel.

Yes, there is a plugin baked into oh-my-zsh, this allows easy fzf integration for other frameworks and shells, and adds some helper scripts.

Note - while these scripts could all be ZSH functions instead of scripts in the bin directory, it uses standalone scripts so that non-ZSH users can also use the repository by adding its bin directory to their $PATH.

Contents

Name Description Author
asdf-install Install one or more versions of the specified language with fzf and installs your selection with asdf fzf wiki
asdf-uninstall Select one or more versions of the specified language with fzf and uninstalls your selection with asdf fzf wiki
chrome-bookmark-browser Rummages through your Chrome bookmarks with fzf and opens the selected bookmark(s) in your default browser fzf wiki
d-attach Uses fzf to select docker containers to start and attach to. From the fzf wiki
d-image-rm Uses fzf to select docker images to remove. From the fzf wiki
d-rm Uses fzf to select docker containers to remove. From the fzf wiki
d-stop-container Stop a Docker container.
falias Searches your ZSH aliases, then puts your selection on the mac clipboard (macOS only)
fif Uses fzf and rg to find a term in files Boost Your Command-Line Productivity With Fuzzy Finder
fzf-brew-cask-install Uses fzf to select programs to install (or show the home page) based on the output of brew cask search Boost Your Command-Line Productivity With Fuzzy Finder
fzf-brew-cask-uninstall Uses fzf to select brew-installed programs to delete (or show the home page) Boost Your Command-Line Productivity With Fuzzy Finder
fzf-brew-install Uses fzf to select programs to install based on the output of brew search Boost Your Command-Line Productivity With Fuzzy Finder
fzf-brew-uninstall Uses fzf to select brew-installed programs to delete Boost Your Command-Line Productivity With Fuzzy Finder
fzf-brew-update Uses fzf to select brew-installed programs to update Boost Your Command-Line Productivity With Fuzzy Finder
fzf-find-edit Uses fzf to select files (displaying previews) to edit with $EDITOR Boost Your Command-Line Productivity With Fuzzy Finder
fzf-git-branch Uses fzf to select a branch name in a git repository for use in scripts From Mark Nielsen's Fuzzy Git Checkout article
fzf-git-checkout Uses fzf to check out a branch in a git repository From Mark Nielsen's Fuzzy Git Checkout article
fzf-grep-edit Uses fzf to select files (displaying previews) that contain a search term to edit with $EDITOR Boost Your Command-Line Productivity With Fuzzy Finder
fzf-kill Uses fzf to select processes to kill Boost Your Command-Line Productivity With Fuzzy Finder
fzf-vscode Uses fzf and rg to search for text and then open the file in vscode Hangops post by Mark Carey
lessfilter-fzf A less pre-processor to nicely display a wide range of file formats, including images and directories that can be used to show fzf previews (see Customization section). Aloxaf/fzf-tab - Wiki/Preview
pr-list Use fzf to select a PR using gh ?
tm Uses fzf to search for a tmux session or create one if there are no matches. From the fzf wiki
tmux-kill Uses fzf to select a tmux session and kill it. From the fzf wiki
tmux-search Uses fzf to select a tmux session. Skips fzf if there's only one match, exits if no match. From the fzf wiki
vagrant-box-search Uses fzf to select a vagrant box and connect to it with ssh. From the fzf wiki

Installing

You should set this plugin to be last, or near to last in your framework's list of plugins to load. It dynamically generates $FZF_DEFAULT_OPT and $FZF_DEFAULT_COMMAND based on whether it sees things like rg and bat in your $PATH, so it should come after other plugins have had a chance to extend your $PATH.

Zgenom

Add zgenom load unixorn/fzf-zsh-plugin to your .zshrc with your other load commands.

Antigen

Add antigen bundle unixorn/fzf-zsh-plugin@main to your .zshrc

Note that until zsh-users/antigen#717 gets fixed in Antigen, it only recognizes plugins in master branch. So you need to explicitly specify @main here.

Oh-My-Zsh

  1. git clone --depth 1 https://github.com/unixorn/fzf-zsh-plugin.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/fzf-zsh-plugin
  2. Add fzf-zsh-plugin to your plugin list - edit ~.zshrc and change plugins=(...) to plugins=(... fzf-zsh-plugin)

Without using a framework

  1. git clone --depth 1 [email protected]:unixorn/fzf-zsh-plugin.git, then add its bin directory to your $PATH.
  2. Add source /path/to/repository/checkout/fzf-zsh-plugin.plugin.zsh to your .zshrc file.

The scripts in this collection don't actually require you to be using ZSH as your login shell, they're being distributed as an oh-my-zsh-compatible plugin because it's convenient for me.

(optional) Install recommended tools

Optionally, to make the most out of fzf preview (? toggle), install the following tools and enable the advanced preview (see Customization section):

  • exa - improved file/directory listing,
  • bat - a cat clone with syntax highlighting and Git integration,
  • chafa - show images (the image can look better or worse depending on the terminal app you use),
  • exiftool - also show image metadata,
  • lesspipe.sh, e.g. brew install lesspipe - and other optional tools lesspipe.sh relies on. See https://github.com/wofr06/lesspipeNote: This is not the lesspipe already bundled in Ubuntu/Debian but an improved one (while package is called lesspipe, the binary is lesspipe.sh).

Customization

You can customize a few features by exporting the following environment variables in your init script (.zshrc/.bashrc or similar):

Export variable Description
export FZF_PREVIEW_ADVANCED=true Use less viewer with a pre-processor to display improved previews for a wide range of files (requires you to install at least exa, bat, chafa, exiftool; and very recommended lesspipe.sh and the tools it uses underneath: mdcat, in2csv,...). This is an opt-in feature.
export FZF_PREVIEW_WINDOW='' Set any value supported by fzf --preview-window option, e.g. right:65%:nohidden will show the preview by default.
export FZF_PATH='' Path to install fzf binary and script, e.g. ${HOME}/.config/fzf.

A note on lessfilter-fzf

You can also use it as a general less preprocessor to extend the less capabilities. To do that, place the following in your shell init scripts (.zshrc/.bashrc or equivalent):

export LESSOPEN='| lessfilter-fzf %s'

Ultimately, lesspipe.sh (if present) will still honor your own lessfilter if found in your PATH, leading to the following execution: lessfilter-fzf > lesspipe.sh > lessfilter.

Other FZF resources

More Repositories

1

awesome-zsh-plugins

A collection of ZSH frameworks, plugins, themes and tutorials.
Shell
13,445
star
2

git-extra-commands

A collection of git utilities and useful extra git scripts.
Shell
918
star
3

zsh-quickstart-kit

A simple ZSH quickstart for using ZSH, zgenom, oh-my-zsh and a curated list of extra plugins. It is designed to be easy to customize without requiring you to maintain your own fork.
Shell
680
star
4

sysadmin-reading-list

A reading and viewing list for larval stage sysadmins and SREs
472
star
5

luggage

Project to automate OS X package creation without using the packagemaker GUI
Makefile
391
star
6

tumult.plugin.zsh

Tumult is a collection of macOS-specific functions and scripts for your shell environment. It is packaged as a ZSH plugin, but can be used with other shells as well.
Shell
153
star
7

aws-lambda-list

A list of hopefully useful AWS lambdas and lambda-related resources.
141
star
8

lima-xbar-plugin

xbar/Swiftbar plugin to control lima-vm
Python
81
star
9

works-with-home-assistant

Equipment and software that works with Home Assistant. And stuff that didn't so we can avoid it.
63
star
10

luggage-examples

Example luggage packages
Makefile
60
star
11

warhol.plugin.zsh

Colorize command output using grc and lscolors
Shell
55
star
12

chocolate-factory-engineering-docs

A collection of hopefully useful document templates for engineering orgs
39
star
13

autoupdate-antigen.zshplugin

Add automatic updating to antigen
Shell
27
star
14

docker-helpers.zshplugin

Miscellaneous utility scripts and aliases for use with Docker.
Shell
26
star
15

ha-mqtt-discoverable

Python module to create MQTT entities that are automatically discovered by Home Assistant
Python
23
star
16

autoupdate-zgen

Autoupdate plugin for zgen
Shell
20
star
17

jpb.zshplugin

ZSH plugin to load some of my tools.
Shell
20
star
18

bitbucket-git-helpers.plugin.zsh

Add some git helper scripts for dealing with repos on bitbucket
Ruby
17
star
19

jira-commands

Some command-line tools for interacting with JIRA
Python
16
star
20

osxtoolkit

Miscellaneous scripts to make OS X administration easier.
Ruby
13
star
21

rake-completion.zshplugin

rake task tab completion plugin for zsh, suitable for use with zgen and other oh-my-zsh compatible frameworks
Shell
8
star
22

apgar

Apgar is a quick and dirty health checker driver written in go.
Go
8
star
23

kubectx-zshplugin

Loads kubectx and kubens automagically for you
Shell
7
star
24

1password-op.plugin.zsh

ZSH plugin to load completions and aliases for 1Password's `op` tool
Shell
7
star
25

bigriver-tools

Some scripts for dealing with AWS
Python
6
star
26

docker-cupsd

cupsd in a docker container
Dockerfile
6
star
27

osx-dmg-tests

Making a separate repo for the disk image test suite that was in the pymacadmin project. No good reason other than that I don't like kitchen sink repos, this one is just the disk tests.
Python
6
star
28

gitlike-commands

Easy python module for creating git-style subcommand handling.
Python
6
star
29

containerized-awscli

Run the aws cli in a container
Shell
5
star
30

ocr-screenshots-macos

OCR all your screenshots automagically
Ruby
4
star
31

blog-scripts

Scripts from my blog
Shell
3
star
32

online-devops-meetups

Free online devops meetups.
3
star
33

logrus

A collection of random utility functions
Python
3
star
34

sourdough

Chef auto-self-registry tooling
Python
3
star
35

rvm-plugin

Autoload rvm if present
Shell
3
star
36

ha-mqtt-discoverable-cli

A cli for creating Home Assistant compatible MQTT entities that will be automatically discovered.
Python
2
star
37

ec2-tagread

Helper script to let bash scripts read EC2 tags
Python
2
star
38

thoth-duplicacy

Container for duplicacy and duplicacy-utils
Shell
2
star
39

thelogrus

Python 3 version of logrus
Python
2
star
40

haze

Some EC2 utility functions and scripts
Python
2
star
41

unixorn.github.io

HTML
2
star
42

doctoc-docker

Docker container for running doctoc
Ruby
2
star
43

SetupSSHonAMIs

I needed to create an AWS marketplace AMI at work, so the instances needed to get their authorized_keys set from the keypair specified to AWS.
Ruby
2
star
44

shellshock-patch-osx

This will download Apple's bash source, patch it, build it, and create a pkg file for you
2
star
45

rage-quit.plugin.zsh

Perl
2
star
46

jpb-utilities

Various utility scripts
Python
1
star
47

zsh-starterkit

zsh is great. starterkit makes it even better. start with omz and add this plugin to get great defaults.
Shell
1
star
48

docker-masquerade

ZSH Plugin full of shim scripts that run commands in docker containers instead of natively
Shell
1
star
49

poseidon

Kubernetes utility scripts
1
star
50

zsh-lunch-and-learn

Lunch and learn about ZSH
JavaScript
1
star
51

slackmoji

Random useful images for slack emoji.
1
star
52

k8s-helpers.zshplugin

Some helper functions I use with kubernetes
Shell
1
star
53

elasticsearch-shell-helpers

Helper scripts for elasticsearch
Shell
1
star
54

home-assistant-to-twilio-sms

Shell
1
star
55

arm-toolkit

Some scripts I like to have on my ARM cluster nodes
Perl
1
star
56

chef-valkyrie

chef-valkyrie purges dead EC2 instances from your Chef Server
Python
1
star
57

pyvizio-docker

pyvisio in a docker container
Ruby
1
star
58

pdcrier

Create/update PagerDuty alerts from the command line
Python
1
star
59

throttle.zsh-plugin

Limit the amount of CPU an application can gobble up on macOS
1
star
60

clio

Docker container for backing up local directories
1
star
61

twilio-sms-zsh-plugin

Adds tooling so you can send an SMS from the command line using Twilio's API
1
star
62

alpython2

alpine + Python 2 + Upgraded pip
Ruby
1
star
63

cookiecutter-zsh-plugin

Template create zsh plugin with cookiecutter
Makefile
1
star
64

ha-franklin

Monitor cupsd print queues and present the information to Home Assistant via MQTT
Python
1
star
65

sysadvent.plugin.zsh

Functions from sysadvent
1
star
66

grok-burnrate

Burnrate custom metric for Grok
Python
1
star
67

themis-lambda

Lambda function to scan an ASG for busy instances and set instance protection on them
Python
1
star
68

unixorn-py3

Python 3 base container
Ruby
1
star
69

history-search-multi-word

Multi-word history searching for Zsh
Shell
1
star
70

autoupdate-zgenom

ZSH Plugin for updating zgenom and its plugins
Shell
1
star