Awesome
fzf-widgets - ZLE widgets of fzf
Overview | Installation | Requirements | Usage | Configuration | License
Overview
This repository manage ZLE widgets of fzf. Available widgets can check here.
Pros
- Can map widgets to whatever key you like
- Can easily install with plugin manager
- Can use with zsh-autosuggestions
- Show error messages with
$POSTDISPLAY
- All widgets are autoloaded function
Installation
You can install with plugin manager.
If use zplug, add the following to your .zshrc
:
zplug 'ytet5uy4/fzf-widgets'
Requirements
zsh
: version 5.0.2 or higher
Usage
- Map widgets to key with
bindkey
command - Execute widget with mapped key
Configuration
You can map widgets to key and specify options of fzf
to widgets.
For example, add the following to your .zshrc
:
if zplug check 'ytet5uy4/fzf-widgets'; then
# Map widgets to key
bindkey '^@' fzf-select-widget
bindkey '^@.' fzf-edit-dotfiles
bindkey '^@c' fzf-change-directory
bindkey '^@n' fzf-change-named-directory
bindkey '^@f' fzf-edit-files
bindkey '^@k' fzf-kill-processes
bindkey '^@s' fzf-exec-ssh
bindkey '^\' fzf-change-recent-directory
bindkey '^r' fzf-insert-history
bindkey '^xf' fzf-insert-files
bindkey '^xd' fzf-insert-directory
bindkey '^xn' fzf-insert-named-directory
## Git
bindkey '^@g' fzf-select-git-widget
bindkey '^@ga' fzf-git-add-files
bindkey '^@gc' fzf-git-change-repository
# GitHub
bindkey '^@h' fzf-select-github-widget
bindkey '^@hs' fzf-github-show-issue
bindkey '^@hc' fzf-github-close-issue
## Docker
bindkey '^@d' fzf-select-docker-widget
bindkey '^@dc' fzf-docker-remove-containers
bindkey '^@di' fzf-docker-remove-images
bindkey '^@dv' fzf-docker-remove-volumes
# Enable Exact-match by fzf-insert-history
FZF_WIDGET_OPTS[insert-history]='--exact'
# Start fzf in a tmux pane
FZF_WIDGET_TMUX=1
fi
License
Copyright (c) 2017 ytet5uy4
Released under the MIT License, see LICENSE.md.