From 8b9bc47b7f84a96b9182e6614e812abf190f52e8 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Tue, 28 Jan 2020 14:04:21 +0300 Subject: [PATCH] MAGIC_EQUAL_SUBST like completion --- zsh/.zshrc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/zsh/.zshrc b/zsh/.zshrc index 056f919..119bc38 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -156,7 +156,13 @@ alias zc="zcalc" zstyle ":completion:*:functions" ignored-patterns "_*" zstyle ":completion:*" matcher-list "" 'm:{a-z\-}={A-Z\_}' 'r:|?=** m:{a-z\-}={A-Z\_}' _mycomp () { - [ $CURRENT -eq 1 ] && _command_names || _files + [ $CURRENT -eq 1 ] && _command_names || _files && return 0 + # MAGIC_EQUAL_SUBST {{{ + [[ "$PREFIX" = *\=* ]] || return 1 + compstate[parameter]="${PREFIX%%\=*}" + compset -P 1 "*=" + _value + # }}} } zstyle ":completion:*" completer _mycomp _parameters autoload -U compinit ; compinit -d /tmp/.zcompdump -- 2.44.0