First of all, you need to install peco, percol, or fzf (, or fzf-tmux)
Put all files somewhere in your $fpath, and add the following lines to your .zshrc:
autoload -Uz anyframe-init
anyframe-init
# download all files
% cd /path/to/dir
% git clone https://github.com/mollifier/anyframe
And add the following lines to your .zshrc:
fpath=(/path/to/dir/anyframe(N-/) $fpath)
autoload -Uz anyframe-init
anyframe-init
If you use Antigen, add the following line to your .zshrc:
antigen bundle mollifier/anyframe
You can map anyframe widgets to whatever key you like.
For example, add the following lines to your .zshrc:
bindkey '^xb' anyframe-widget-cdr
bindkey '^x^b' anyframe-widget-checkout-git-branch
bindkey '^xr' anyframe-widget-execute-history
bindkey '^x^r' anyframe-widget-execute-history
bindkey '^xi' anyframe-widget-put-history
bindkey '^x^i' anyframe-widget-put-history
bindkey '^xg' anyframe-widget-cd-ghq-repository
bindkey '^x^g' anyframe-widget-cd-ghq-repository
bindkey '^xk' anyframe-widget-kill
bindkey '^x^k' anyframe-widget-kill
bindkey '^xe' anyframe-widget-insert-git-branch
bindkey '^x^e' anyframe-widget-insert-git-branch
Some widgets requires external commands.
require cdr
To use cdr, add the following line to your .zshrc:
autoload -Uz chpwd_recent_dirs cdr add-zsh-hook
add-zsh-hook chpwd chpwd_recent_dirs
for more information, see REMEMBERING RECENT DIRECTORIES section in man zshcontrib(1)
require ghq
# expressly specify to use peco
zstyle ":anyframe:selector:" use peco
# expressly specify to use percol
zstyle ":anyframe:selector:" use percol
# expressly specify to use fzf-tmux
zstyle ":anyframe:selector:" use fzf-tmux
# expressly specify to use fzf
zstyle ":anyframe:selector:" use fzf
# specify path and options for peco, percol, or fzf
zstyle ":anyframe:selector:peco:" command 'peco --no-ignore-case'
zstyle ":anyframe:selector:percol:" command 'percol --case-sensitive'
zstyle ":anyframe:selector:fzf-tmux:" command 'fzf-tmux --extended'
zstyle ":anyframe:selector:fzf:" command 'fzf --extended'