From d1605ba34ca569b64882a02e2948f16d4d94978e Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 30 Aug 2019 16:50:20 +0200 Subject: zsh: improve docker-compose setup --- zsh/.config/zsh/.zshrc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'zsh') diff --git a/zsh/.config/zsh/.zshrc b/zsh/.config/zsh/.zshrc index 9be59a1..c32daa6 100644 --- a/zsh/.config/zsh/.zshrc +++ b/zsh/.config/zsh/.zshrc @@ -77,6 +77,16 @@ bindkey '\e[3~' delete-char bindkey '\C-hd' describe-key-briefly +dc () { + if [[ -x ./docker-compose ]] + then + ./docker-compose "$@" + else + docker-compose "$@" + fi +} +compdef '_dispatch docker-compose docker-compose' dc + backward-argument () { local WORDCHARS="\!\`~#@$%^&*()-_=+[{]}\|;:,<.>/?\'\"" zle backward-word @@ -145,6 +155,8 @@ zplugin ice if'[[ $os -eq darwin ]]' zplugin snippet "OMZ::lib/functions.zsh" zplugin ice if'[[ $os -eq darwin ]]' zplugin snippet "OMZ::lib/termsupport.zsh" +zplugin ice id-as'docker-compose-completion' +zplugin snippet "https://github.com/docker/compose/raw/1.24.1/contrib/completion/zsh/_docker-compose" zplugin ice if'[[ $os -eq darwin ]]' wait'1' lucid zplugin load "unixorn/tumult.plugin.zsh" @@ -255,6 +267,6 @@ fi unsetopt flow_control # Let me use ^S and ^Q -zplugin ice wait'1' if'[[ -z $SSH_CLIENT ]]' lucid #atinit'zpcompinit; zpcdreplay -q' +zplugin ice wait'1' if'[[ -z $SSH_CLIENT ]]' lucid atinit'zpcompinit; zpcdreplay -q' zplugin load "zdharma/fast-syntax-highlighting" -- cgit 1.4.1