1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2024-12-14 11:57:34 +00:00

zsh: add fzf completion for docker containers

This commit is contained in:
Daiderd Jordan 2017-06-17 21:46:49 +02:00
parent 983c465a72
commit f5efd16be6
No known key found for this signature in database
GPG key ID: D02435D05B810C96

View file

@ -106,6 +106,15 @@ _fzf_complete() {
command rm -f "$fifo"
}
_fzf_complete_docker() {
FZF_DEFAULT_OPTS="--min-height 15 $FZF_DEFAULT_OPTS --preview 'docker ps -af ancestor={+3} -n 4' --preview-window down:5:wrap" \
_fzf_complete '-m --header-lines=1' "$@" < <(docker images)
}
_fzf_complete_docker_post() {
awk '{print $1 ":" $2}'
}
_fzf_complete_git() {
FZF_DEFAULT_OPTS="--min-height 15 $FZF_DEFAULT_OPTS --preview 'git log -5 --oneline {+1}' --preview-window down:5:wrap" \
_fzf_complete '-m' "$@" < <(git branch -v)